]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
bpf, arm64: Feed byte-offset into bpf line info
authorHou Tao <houtao1@huawei.com>
Sat, 26 Feb 2022 12:19:06 +0000 (20:19 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:46 +0000 (11:57 +0200)
commitc9f15364d95ac773719c67b7a420fa223c0dd5eb
tree7411c68bda7853a077d1714a93191f17321347f0
parent8e8666e261c57ff77fa35c6ff157c4a368428d32
bpf, arm64: Feed byte-offset into bpf line info

BugLink: https://bugs.launchpad.net/bugs/1969110
[ 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@iogearbox.net>
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220226121906.5709-3-houtao1@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit c08f23081c9bddc4a53e14481d3cd273fa16fe88)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/arm64/net/bpf_jit_comp.c