diff options
| author | Alexei Starovoitov <[email protected]> | 2021-07-15 00:54:07 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2021-07-15 20:31:10 +0000 |
| commit | d809e134be7a1fdd9f5b99ab3291c6da5c0b8240 (patch) | |
| tree | a777e2e1bfec485860b673d4b05fded73fd7c1fb /scripts/bpf_doc.py | |
| parent | selftests/bpf: Remove unused variable in tc_tunnel prog (diff) | |
| download | kernel-d809e134be7a1fdd9f5b99ab3291c6da5c0b8240.tar.gz kernel-d809e134be7a1fdd9f5b99ab3291c6da5c0b8240.zip | |
bpf: Prepare bpf_prog_put() to be called from irq context.
Currently bpf_prog_put() is called from the task context only.
With addition of bpf timers the timer related helpers will start calling
bpf_prog_put() from irq-saved region and in rare cases might drop
the refcnt to zero.
To address this case, first, convert bpf_prog_free_id() to be irq-save
(this is similar to bpf_map_free_id), and, second, defer non irq
appropriate calls into work queue.
For example:
bpf_audit_prog() is calling kmalloc and wake_up_interruptible,
bpf_prog_kallsyms_del_all()->bpf_ksym_del()->spin_unlock_bh().
They are not safe with irqs disabled.
Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Acked-by: Toke Høiland-Jørgensen <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'scripts/bpf_doc.py')
0 files changed, 0 insertions, 0 deletions
