diff options
| author | Thomas Gleixner <[email protected]> | 2020-02-24 14:01:49 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-02-25 00:20:10 +0000 |
| commit | b6e5dae15a61b0cc9219799926813baad0b58967 (patch) | |
| tree | 54d5a5804fe457956725474e079ec989054cba3c /scripts/bpf_helpers_doc.py | |
| parent | bpf: Use recursion prevention helpers in hashtab code (diff) | |
| download | kernel-b6e5dae15a61b0cc9219799926813baad0b58967.tar.gz kernel-b6e5dae15a61b0cc9219799926813baad0b58967.zip | |
bpf: Replace open coded recursion prevention in sys_bpf()
The required protection is that the caller cannot be migrated to a
different CPU as these functions end up in places which take either a hash
bucket lock or might trigger a kprobe inside the memory allocator. Both
scenarios can lead to deadlocks. The deadlock prevention is per CPU by
incrementing a per CPU variable which temporarily blocks the invocation of
BPF programs from perf and kprobes.
Replace the open coded preempt_[dis|en]able and __this_cpu_[inc|dec] pairs
with the new helper functions. These functions are already prepared to make
BPF work on PREEMPT_RT enabled kernels. No functional change for !RT
kernels.
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'scripts/bpf_helpers_doc.py')
0 files changed, 0 insertions, 0 deletions
