bpf: Allow bpf_for/bpf_repeat while holding spin
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 0 repliesApplied 2/2
- v12 patches 6 repliesSuperseded
Patches in v2 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: Allow bpf_for/bpf_repeat calls while holding a spinlockkernel/ | +19 | 0 replies | Applied |
| 2/2 | selftests/bpf: test bpf_for within spin lock sectiontools/ | +26 | 0 replies | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Eduard Zingerman |
|---|---|
| 1/2 | R-b |
| 2/2 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] bpf: Allow bpf_for/bpf_repeat while holding spin
From: Emil Tsalapatis (Meta) <[email protected]>
In BPF programs, kfunc calls while holding a lock are not allowed because kfuncs may sleep by default. The exception to this rule are the functions in special_kfunc_list, which are guaranteed to not sleep. The bpf_iter_num_* functions used by the bpf_for and bpf_repeat macros make no function calls themselves, and as such are guaranteed to not sleep. Add them to special_kfunc_list to allow them within BPF spinlock critical sections.
Emil Tsalapatis (2):
bpf: Allow bpf_for/bpf_repeat calls while holding a spinlock selftests/bpf: test bpf_for within spin lock section
kernel/bpf/verifier.c | 20 +++++++++++++- .../selftests/bpf/progs/verifier_spin_lock.c | 26 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-)
Signature · 1 line
2.47.1