Skip to content

bpf: Fix LRU NMI/tracepoint re-entry deadlock

Mykyta Yatsenko bpf 3 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected] change-id 20260519-lru_map_spin-8e20dabbf460

Versions newest first

  1. v3 Latest3 patches 1 replyApplied 3/3
  2. v2 RFC3 patches 2 repliesSuperseded
  3. v1 RFC3 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Removed RFC tag
- Link to v2: https://patch.msgid.link/[email protected]

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: Fix NMI/tracepoint re-entry deadlock on lru lockskernel/bpf/bpf_lru_list.c kernel/bpf/bpf_lru_list.h+119 -711 replyApplied
2/3Documentation/bpf: Refresh map_lru_hash_update.dot for rqspinlockDocumentation/bpf/map_lru_hash_update.dot+42 -20 repliesApplied
3/3selftests/bpf: Stress LRU rqspinlock recovery pathstools/testing/selftests/bpf/prog_tests/lru_lock_nmi.c tools/testing/selftests/bpf/progs/lru_lock_nmi.c+276 -00 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH bpf-next v3 0/3] bpf: Fix LRU NMI/tracepoint re-entry deadlock

This series fixes AA-deadlocks where NMI and tracepoint BPF programs re-enter the per-CPU or global LRU lock already held on the same CPU (syzbot c69a0a2c816716f1e0d5, 18b26edb69b2e19f3b33).

Patch 1 converts every LRU lock site to rqspinlock_t and adds explicit recovery for some failures so no node leaks.

Patch 2 refreshes Documentation/bpf/map_lru_hash_update.dot to show the new rqspinlock failure exits and recovery routes.

Patch 3 introduces a stress test.

---
Changes in v3:
- Removed RFC tag
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Patch 1: __bpf_lru_node_move_in() now clears pending_free only when moving to the FREE list.
- Patch 3: address sashiko's feedback.
- Link to v1: https://patch.msgid.link/[email protected]

---
Mykyta Yatsenko (3):
bpf: Fix NMI/tracepoint re-entry deadlock on lru locks Documentation/bpf: Refresh map_lru_hash_update.dot for rqspinlock selftests/bpf: Stress LRU rqspinlock recovery paths

 Documentation/bpf/map_lru_hash_update.dot          |  44 +++-
 kernel/bpf/bpf_lru_list.c                          | 165 ++++++++------
 kernel/bpf/bpf_lru_list.h                          |  25 ++-
 .../selftests/bpf/prog_tests/lru_lock_nmi.c        | 243 +++++++++++++++++++++
 tools/testing/selftests/bpf/progs/lru_lock_nmi.c   |  33 +++
 5 files changed, 437 insertions(+), 73 deletions(-)

---
base-commit: 245da8192c073820390f7fa1cc1e834b32119bce
change-id: 20260519-lru_map_spin-8e20dabbf460

Best regards,

Signature · 1 line
Mykyta Yatsenko <[email protected]>