Skip to content

bpf: fix verification of indirect var-off stack access

Andrei Matei bpf 6 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. v5 Latest3 patches 0 repliesApplied 3/3
  2. v42 patches 4 repliesSuperseded
  3. v32 patches 5 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v2 posting 2/21 patch16 repliesSuperseded
v2 posting 1/20 of 1 patch0 repliesSuperseded
v11 patch3 repliesSuperseded

Changes in v5 from the cover letter

- split the test into a separate patch

Patches in v5 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: fix verification of indirect var-off stack accesskernel/bpf/verifier.c+4 -100 repliesApplied
2/3bpf: add verifier regression test for previous patchtools/testing/selftests/bpf/progs/verifier_var_off.c+29 -00 repliesApplied
3/3bpf: guard stack limits against 32bit overflowkernel/bpf/verifier.c+3 -30 repliesApplied

Reviews trailers per patch

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

PatchEduard ZingermanAndrii Nakryiko
1/3A-b A-b
2/3A-b
3/3A-b

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

Read the v5 thread

Cover letter [PATCH bpf-next v5 0/3] bpf: fix verification of indirect var-off stack access

V4 to V5:
- split the test into a separate patch

V3 to V4:
- include a test per Eduard's request
- target bpf-next per Alexei's request (patches didn't change)

V2 to V3:
- simplify checks for max_off (don't call check_stack_slot_within_bounds for it)
- append a commit to protect against overflow in the addition of the register and the offset

V1 to V2:
- fix max_off calculation for access size = 0

Andrei Matei (3):
bpf: fix verification of indirect var-off stack access
bpf: add verifier regression test for previous patch
bpf: guard stack limits against 32bit overflow

 kernel/bpf/verifier.c                         | 20 +++++--------
 .../selftests/bpf/progs/verifier_var_off.c    | 29 +++++++++++++++++++
 2 files changed, 36 insertions(+), 13 deletions(-)
Signature · 1 line
2.40.1