RFC Fix deadlock with bpf_timer in fentry/fexit progs
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 7 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: Fix deadlock for bpf_timer's spinlockkernel/ tools/ tools/ +2 more | +34 | 7 replies | |
| 2/2 | selftests/bpf: Add timer deadlock exampletools/ tools/ | +79 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH RFC bpf-next v1 0/2] Fix deadlock with bpf_timer in fentry/fexit progs
Hi, this is a fix for a deadlock condition I noticed (and verified by constructing a test case, see patch #2) while looking at the code. There might be alternative ways to solve this, like having percpu map ops recursion counter, and detecting reentrancy based on that. I went for the simpler option for now.
Previous discussions on a patch doing something similar for a different issue here, but never added BPF_PROG_TYPE_TRACING to this list:
https://lore.kernel.org/bpf/CALOAHbBK1=ujbZp5n4t9zQf+DPZ3-a2ZDL0a3sfhVU6meJGqYw@mail.gmail.com
https://lore.kernel.org/bpf/CALOAHbAQ7AKNPrkawGKHarkB5CGkWXTC8P=+EJP3DAPNEf=Ayw@mail.gmail.com
Note that timer and timer_crash selftests are broken by this change, so it has potential for wider breakage.
Kumar Kartikeya Dwivedi (2):
bpf: Fix deadlock for bpf_timer's spinlock [EXAMPLE] selftests/bpf: Add timer deadlock example
kernel/bpf/verifier.c | 10 ++-- .../testing/selftests/bpf/prog_tests/timer.c | 21 +++++--- .../selftests/bpf/prog_tests/timer_crash.c | 9 +++- .../selftests/bpf/prog_tests/timer_deadlock.c | 29 +++++++++++ tools/testing/selftests/bpf/progs/timer.c | 8 +-- .../testing/selftests/bpf/progs/timer_crash.c | 4 +- .../selftests/bpf/progs/timer_deadlock.c | 50 +++++++++++++++++++ 7 files changed, 113 insertions(+), 18 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/timer_deadlock.c create mode 100644 tools/testing/selftests/bpf/progs/timer_deadlock.c
base-commit: 25906092edb4bcf94cb669bd1ed03a0ef2f4120c --
2.38.1