]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
arm64/ftrace,bpf: Fix partial regs after bpf_prog_run
authorJiri Olsa <jolsa@kernel.org>
Mon, 12 Jan 2026 12:11:56 +0000 (13:11 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 16 Jan 2026 00:15:25 +0000 (16:15 -0800)
commit276f3b6daf6024ae2742afd161e7418a5584a660
tree1f93c852b612aee28bf0979890e8d3b792787485
parent9a403a4aea32f1801a7f29b2385ec345d4faaf78
arm64/ftrace,bpf: Fix partial regs after bpf_prog_run

Mahe reported issue with bpf_override_return helper not working when
executed from kprobe.multi bpf program on arm.

The problem is that on arm we use alternate storage for pt_regs object
that is passed to bpf_prog_run and if any register is changed (which
is the case of bpf_override_return) it's not propagated back to actual
pt_regs object.

Fixing this by introducing and calling ftrace_partial_regs_update function
to propagate the values of changed registers (ip and stack).

Reported-by: Mahe Tardy <mahe.tardy@gmail.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/bpf/20260112121157.854473-1-jolsa@kernel.org
include/linux/ftrace_regs.h
kernel/trace/bpf_trace.c