]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
powerpc64/bpf: fix the address returned by bpf_get_func_ip
authorHari Bathini <hbathini@linux.ibm.com>
Tue, 3 Mar 2026 18:10:26 +0000 (23:40 +0530)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Sat, 7 Mar 2026 10:32:26 +0000 (16:02 +0530)
commit157820264ac3dadfafffad63184b883eb28f9ae0
tree7994e2538209d1afe57e872657f352dbf137f2bd
parent521bd39d9d28ce54cbfec7f9b89c94ad4fdb8350
powerpc64/bpf: fix the address returned by bpf_get_func_ip

bpf_get_func_ip() helper function returns the address of the traced
function. It relies on the IP address stored at ctx - 16 by the bpf
trampoline. On 64-bit powerpc, this address is recovered from LR
accounting for OOL trampoline. But the address stored here was off
by 4-bytes. Ensure the address is the actual start of the traced
function.

Reported-by: Abhishek Dubey <adubey@linux.ibm.com>
Fixes: d243b62b7bd3 ("powerpc64/bpf: Add support for bpf trampolines")
Cc: stable@vger.kernel.org
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260303181031.390073-3-hbathini@linux.ibm.com
arch/powerpc/net/bpf_jit_comp.c