From: Ning Ding <dingning04@gmail.com>
To: bpf@vger.kernel.org
Cc: memxor@gmail.com, puranjay@kernel.org, paulmck@kernel.org,
Ning Ding <dingning04@gmail.com>
Subject: [PATCH bpf-next 0/2] bpf: Track overlapping RCU protection
Date: Wed, 5 Aug 2026 16:39:32 -0700 [thread overview]
Message-ID: <20260805233940.3966981-1-dingning04@gmail.com> (raw)
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
next reply other threads:[~2026-08-05 23:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 23:39 Ning Ding [this message]
2026-08-05 23:39 ` [PATCH bpf-next 1/2] bpf: Account for preempt and IRQ state in RCU protection 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260805233940.3966981-1-dingning04@gmail.com \
--to=dingning04@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=memxor@gmail.com \
--cc=paulmck@kernel.org \
--cc=puranjay@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox