summaryrefslogtreecommitdiff
path: root/scripts/basic/split-include.c
diff options
context:
space:
mode:
authorJose Fernandez (Anthropic) <jose.fernandez@linux.dev>2026-10-30 18:14:22 +0000
committerAlexei Starovoitov <ast@kernel.org>2026-10-30 21:33:15 +0000
commit3e4279dc5144a5afcda101df23792b13e94c3859 (patch)
tree6f56f76723620860a576f780066ded0428fbb45a /scripts/basic/split-include.c
parent99681d9a384f864543ec53fdb9f25800c12cfec3 (diff)
downloadlinux-3e4279dc5144a5afcda101df23792b13e94c3859.tar.gz
linux-3e4279dc5144a5afcda101df23792b13e94c3859.zip
bpf: Fix jited line info off by the CFI preamble
With CONFIG_CFI=y, every jited line info entry after a function's first is cfi_get_offset() bytes too high on x86-64, riscv64 and arm64, so tools that use it show the wrong source line. The JITs count the insn_to_jit_off[] offsets from the start of the image. Since the CFI commits below, prog->bpf_func starts cfi_get_offset() bytes into the image, and bpf_prog_fill_jited_linfo() adds the offsets to prog->bpf_func. s390 corrects its offsets before the call, the other three JITs do not. Subtract cfi_get_offset() once in bpf_prog_fill_jited_linfo() and drop the s390 correction. jited_linfo[0] stays prog->bpf_func, the function's ksym address. Without CONFIG_CFI, cfi_get_offset() is 0 and nothing changes. Fixes: 4f9087f16651 ("x86/cfi,bpf: Fix BPF JIT call") Fixes: e63985ecd226 ("bpf, riscv64/cfi: Support kCFI + BPF on riscv64") Fixes: 710618c760c0 ("arm64/cfi,bpf: Support kCFI + BPF on arm64") Reported-by: Sashiko <sashiko-bot@kernel.org> Reported-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Jose Fernandez (Anthropic) <jose.fernandez@linux.dev> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://patch.msgid.link/20261030-b4-arm64-bpf-linfo-cfi-v2-1-4eac83435d4b@linux.dev Closes: https://lore.kernel.org/all/20260904014748.C04AA1F000E9@smtp.kernel.org/ Closes: https://lore.kernel.org/all/DLNXZ2WK7TPD.2RZBUNRS4FA4L@gmail.com/
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions