Patch "bpf, arm64: Feed byte-offset into bpf line info" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    bpf, arm64: Feed byte-offset into bpf line info

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bpf-arm64-feed-byte-offset-into-bpf-line-info.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e9a433881cb0b49782fbd4948a39d47f8a070845
Author: Hou Tao <houtao1@xxxxxxxxxx>
Date:   Sat Feb 26 20:19:06 2022 +0800

    bpf, arm64: Feed byte-offset into bpf line info
    
    [ Upstream commit dda7596c109fc382876118627e29db7607cde35d ]
    
    insn_to_jit_off passed to bpf_prog_fill_jited_linfo() is calculated in
    instruction granularity instead of bytes granularity, but BPF line info
    requires byte offset.
    
    bpf_prog_fill_jited_linfo() will be the last user of ctx.offset before
    it is freed, so convert the offset into byte-offset before calling into
    bpf_prog_fill_jited_linfo() in order to fix the line info dump on arm64.
    
    Fixes: 37ab566c178d ("bpf: arm64: Enable arm64 jit to provide bpf_line_info")
    Suggested-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
    Signed-off-by: Hou Tao <houtao1@xxxxxxxxxx>
    Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/bpf/20220226121906.5709-3-houtao1@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index d13d9e5085a7..b56e7bd96594 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -1126,6 +1126,11 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 	prog->jited_len = prog_size;
 
 	if (!prog->is_func || extra_pass) {
+		int i;
+
+		/* offset[prog->len] is the size of program */
+		for (i = 0; i <= prog->len; i++)
+			ctx.offset[i] *= AARCH64_INSN_SIZE;
 		bpf_prog_fill_jited_linfo(prog, ctx.offset + 1);
 out_off:
 		kfree(ctx.offset);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux