The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: Compare iterator types during state pruning
@ 2026-08-07  0:43 Ning Ding
  2026-08-07  0:43 ` [PATCH bpf-next 1/2] " Ning Ding
  2026-08-07  0:43 ` [PATCH bpf-next 2/2] selftests/bpf: Test RCU iterator " Ning Ding
  0 siblings, 2 replies; 3+ messages in thread
From: Ning Ding @ 2026-08-07  0:43 UTC (permalink / raw)
  To: bpf
  Cc: memxor, ast, daniel, andrii, linux-kernel, linux-kselftest, shuah,
	Ning Ding

Iterator stack slots can be marked MEM_RCU or PTR_UNTRUSTED. The
STACK_ITER check in stacksafe() does not compare this type, so state
pruning can treat these states as equal and prune an unsafe path.

Compare the type and add a test where RCU protection has a gap.

Ning Ding (2):
  bpf: Compare iterator types during state pruning
  selftests/bpf: Test RCU iterator state pruning

 kernel/bpf/states.c                           |  3 ++-
 .../selftests/bpf/progs/iters_task_failure.c  | 27 +++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

-- 
2.43.0

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

end of thread, other threads:[~2026-08-07  0:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07  0:43 [PATCH bpf-next 0/2] bpf: Compare iterator types during state pruning Ning Ding
2026-08-07  0:43 ` [PATCH bpf-next 1/2] " Ning Ding
2026-08-07  0:43 ` [PATCH bpf-next 2/2] selftests/bpf: Test RCU iterator " Ning Ding

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