mirror of
https://github.com/torvalds/linux.git
synced 2026-12-05 04:44:03 +00:00
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: 54ecbe6f1e ("rethook: Add a generic return hook")
Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Steven Rostedt (Google) <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/bpf/165461827269.280167.7379263615545598958.stgit@devnote2