diff options
author | Alexei Starovoitov <ast@kernel.org> | 2021-03-16 22:58:15 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2021-03-17 02:43:12 +0300 |
commit | 8a141dd7f7060d1e64c14a5257e0babae20ac99b (patch) | |
tree | 8d58ea8dffd5a052b0a3c71f87ec20c7bede9e95 /kernel/pid.c | |
parent | 31254dc9566221429d2cfb45fd5737985d70f2b6 (diff) | |
download | linux-8a141dd7f7060d1e64c14a5257e0babae20ac99b.tar.xz |
ftrace: Fix modify_ftrace_direct.
The following sequence of commands:
register_ftrace_direct(ip, addr1);
modify_ftrace_direct(ip, addr1, addr2);
unregister_ftrace_direct(ip, addr2);
will cause the kernel to warn:
[ 30.179191] WARNING: CPU: 2 PID: 1961 at kernel/trace/ftrace.c:5223 unregister_ftrace_direct+0x130/0x150
[ 30.180556] CPU: 2 PID: 1961 Comm: test_progs W O 5.12.0-rc2-00378-g86bc10a0a711-dirty #3246
[ 30.182453] RIP: 0010:unregister_ftrace_direct+0x130/0x150
When modify_ftrace_direct() changes the addr from old to new it should update
the addr stored in ftrace_direct_funcs. Otherwise the final
unregister_ftrace_direct() won't find the address and will cause the splat.
Fixes: 0567d6809182 ("ftrace: Add modify_ftrace_direct()")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lore.kernel.org/bpf/20210316195815.34714-1-alexei.starovoitov@gmail.com
Diffstat (limited to 'kernel/pid.c')
0 files changed, 0 insertions, 0 deletions