BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: Track overlapping RCU protection
@ 2026-08-05 23:39 Ning Ding
  2026-08-05 23:39 ` [PATCH bpf-next 1/2] bpf: Account for preempt and IRQ state in " Ning Ding
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ning Ding @ 2026-08-05 23:39 UTC (permalink / raw)
  To: bpf; +Cc: memxor, puranjay, paulmck, Ning Ding

Preemption-disabled and IRQ-disabled regions provide RCU protection, but
the verifier does not account for them. Current implementation can invalidate 
a task kptr while another RCU source remains active, or keep it valid 
after the final source ends.

Track these regions and invalidate RCU-protected pointers only after the
last protection ends. Add task kptr tests for overlapping protection and
final-exit rejection.

This follows review of the applied spin-unlock fix series [1].

Tested in QEMU/KVM:
  ./test_progs -t task_kfunc
  ./test_progs -t preempt_lock
  ./test_progs -t irq

[1] https://lore.kernel.org/r/20260803112615.3362122-1-dingning04@gmail.com

Ning Ding (2):
  bpf: Account for preempt and IRQ state in RCU protection
  selftests/bpf: Test overlapping RCU protection

 kernel/bpf/verifier.c                         |  13 +-
 .../selftests/bpf/prog_tests/task_kfunc.c     |   6 +
 .../selftests/bpf/progs/task_kfunc_common.h   |   2 +
 .../selftests/bpf/progs/task_kfunc_failure.c  |  49 ++++++
 .../selftests/bpf/progs/task_kfunc_success.c  | 147 ++++++++++++++++++
 5 files changed, 214 insertions(+), 3 deletions(-)


base-commit: 11c1e836710dcba03e50454a4eedfdbaf8d3050e
-- 
2.43.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-08-06 21:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 23:39 [PATCH bpf-next 0/2] bpf: Track overlapping RCU protection Ning Ding
2026-08-05 23:39 ` [PATCH bpf-next 1/2] bpf: Account for preempt and IRQ state in " Ning Ding
2026-08-05 23:39 ` [PATCH bpf-next 2/2] selftests/bpf: Test overlapping " Ning Ding
2026-08-06  9:13 ` [PATCH bpf-next 0/2] bpf: Track " Kumar Kartikeya Dwivedi
2026-08-06  9:32   ` Kumar Kartikeya Dwivedi
2026-08-06 15:01     ` Kumar Kartikeya Dwivedi
2026-08-06 21:13       ` Ning Ding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox