diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-11-01 11:17:54 -0700 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2024-11-01 14:39:07 -0400 |
commit | 24507ce81eaf0c34d91f3d1acaa73ee2f796190a (patch) | |
tree | 29bfd26f66ea313fa77d7228c4545531461b7dac /kernel/trace/trace_functions.c | |
parent | 61c6fefa92bb4ed7a34163b94f6ffac628237a29 (diff) |
bpf: ensure RCU Tasks Trace GP for sleepable raw tracepoint BPF links
Now that kernel supports sleepable tracepoints, the fact that
bpf_probe_unregister() is asynchronous, i.e., that it doesn't wait for
any in-flight tracepoints to conclude before returning, we now need to
delay BPF raw tp link's deallocation and bpf_prog_put() of its
underlying BPF program (regardless of program's own sleepable semantics)
until after full RCU Tasks Trace GP. With that GP over, we'll have
a guarantee that no tracepoint can reach BPF link and thus its BPF program.
We use newly added tracepoint_is_faultable() check to know when this RCU
Tasks Trace GP is necessary and utilize BPF link's own sleepable flag
passed through bpf_link_init_sleepable() initializer.
Link: https://lore.kernel.org/20241101181754.782341-3-andrii@kernel.org
Tested-by: Jordan Rife <jrife@google.com>
Reported-by: Jordan Rife <jrife@google.com>
Fixes: a363d27cdbc2 ("tracing: Allow system call tracepoints to handle page faults")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_functions.c')
0 files changed, 0 insertions, 0 deletions