Skip to content

bpf: Compare iterator types during state pruning

Ning Ding bpf linux-kselftest lkml 2 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied 2/2
  2. v12 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Convert the regression test to inline assembly so its verifier-sensitive control-flow layout is stable.
- Add Eduard Zingerman's Acked-by tag to patch 1.

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: Compare iterator types during state pruningkernel/bpf/states.c+2 -10 repliesApplied
2/2selftests/bpf: Test RCU iterator state pruningtools/testing/selftests/bpf/progs/iters_task_failure.c+46 -01 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchEduard Zingerman
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/2] bpf: Compare iterator types during state pruning

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.

---
Changes in v2:
- Convert the regression test to inline assembly so its verifier-sensitive control-flow layout is stable.
- Add Eduard Zingerman's Acked-by tag to patch 1.

v1: https://lore.kernel.org/bpf/[email protected]/

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  | 46 +++++++++++++++++++
 2 files changed, 48 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0