Skip to content

Fix missing process_iter_arg type check

Kumar Kartikeya Dwivedi bpf 2 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesApplied 2/2
  2. v13 patches 2 repliesSuperseded

Changes in v2 from the cover letter

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

* Rebase on bpf/master (Andrii)

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: Ensure reg is PTR_TO_STACK in process_iter_argkernel/bpf/verifier.c tools/testing/selftests/bpf/progs/verifier_bits_iter.c+7 -20 repliesApplied
2/2selftests/bpf: Add tests for iter arg checktools/testing/selftests/bpf/progs/iters.c+26 -00 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH bpf v2 0/2] Fix missing process_iter_arg type check

I am taking over Tao's earlier patch set that can be found at [0], after an offline discussion. The bug reported in that thread is that process_iter_arg missed a reg->type == PTR_TO_STACK check. Fix this by adding it in, and also address comments from Andrii on the earlier attempt. Include more selftests to ensure the error is caught.

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

Changelog:
----------
v1 -> v2:
v1: https://lore.kernel.org/bpf/[email protected]

* Rebase on bpf/master (Andrii)

Kumar Kartikeya Dwivedi (1):
selftests/bpf: Add tests for iter arg check

Tao Lyu (1):
bpf: Ensure reg is PTR_TO_STACK in process_iter_arg

 kernel/bpf/verifier.c                         |  5 ++++
 tools/testing/selftests/bpf/progs/iters.c     | 26 +++++++++++++++++++
 .../selftests/bpf/progs/verifier_bits_iter.c  |  4 +--
 3 files changed, 33 insertions(+), 2 deletions(-)

base-commit: 537a2525eaf76ea9b0dca62b994500d8670b39d5 --
2.43.5