summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests
diff options
context:
space:
mode:
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>2022-06-08 01:11:12 +0900
committerDaniel Borkmann <daniel@iogearbox.net>2022-06-17 21:53:35 +0200
commitc0f3bb4054ef036e5f67e27f2e3cad9e6512cf00 (patch)
tree3a8b879d974634df53f0777bc000184cd21590a7 /tools/testing/selftests/bpf/prog_tests
parentc88dbbcd88c233cb759ec857b57864c5bfcea26a (diff)
downloadlinux-c0f3bb4054ef036e5f67e27f2e3cad9e6512cf00.tar.bz2
rethook: Reject getting a rethook if RCU is not watching
Since the rethook_recycle() will involve the call_rcu() for reclaiming the rethook_instance, the rethook must be set up at the RCU available context (non idle). This rethook_recycle() in the rethook trampoline handler is inevitable, thus the RCU available check must be done before setting the rethook trampoline. This adds a rcu_is_watching() check in the rethook_try_get() so that it will return NULL if it is called when !rcu_is_watching(). Fixes: 54ecbe6f1ed5 ("rethook: Add a generic return hook") Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/bpf/165461827269.280167.7379263615545598958.stgit@devnote2
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests')
0 files changed, 0 insertions, 0 deletions