selftests/bpf: Test RCU pointer invalidation after spin unlock

The verifier previously accepted a task kptr after the final spin unlock
ended its RCU protection in a sleepable program. The pointer could then be
used after the task was freed.

Add a negative test for that case. Add positive controls showing that the
pointer remains valid in a non-sleepable program and while an explicit RCU
read-side section is still active.

Assisted-by: Codex:gpt-5.6-sol
Assisted-by: ChatGPT:GPT-5.6-Pro
Signed-off-by: Ning Ding <dingning04@gmail.com>
Link: https://lore.kernel.org/bpf/20260803112615.3362122-3-dingning04@gmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
This commit is contained in:
Ning Ding 2026-08-03 04:26:09 -07:00 • committed by Kumar Kartikeya Dwivedi
commit bb2df6fd89
No known key found for this signature in database
GPG key ID: 472D377B63542F83
4 changed files with 86 additions and 0 deletions