Skip to content

bpf: Fix incorrect immediate spill

Hao Sun bpf linux-kselftest lkml stable 3 versions – Applied

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

Get series with b4
b4 am [email protected] change-id 20231026-fix-check-stack-write-c40996694dfa

Versions newest first

  1. v3 Latest2 patches 0 repliesApplied 2/2
  2. v22 patches 4 repliesSuperseded
  3. v12 patches 5 repliesSuperseded

Changes in v3 from the cover letter

- Change the expected log to fix the test case
- Link to v2: https://lore.kernel.org/r/[email protected]

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: Fix check_stack_write_fixed_off() to correctly spill immkernel/bpf/verifier.c+1 -10 repliesApplied
2/2selftests/bpf: Add test for immediate spilled to stacktools/testing/selftests/bpf/verifier/bpf_st_mem.c+32 -00 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchShung-Hsi YuEduard Zingerman
1/2A-b A-b
2/2

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

Read the v3 thread

Cover letter [PATCH bpf v3 0/2] bpf: Fix incorrect immediate spill

Immediate is incorrectly cast to u32 before being spilled, losing sign information. The range information is incorrect after load again. Fix immediate spill by remove the cast. The second patch add a test case for this.

---
Changes in v3:
- Change the expected log to fix the test case
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Add fix and cc tags.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Hao Sun (2):
bpf: Fix check_stack_write_fixed_off() to correctly spill imm selftests/bpf: Add test for immediate spilled to stack

 kernel/bpf/verifier.c                             |  2 +-
 tools/testing/selftests/bpf/verifier/bpf_st_mem.c | 32 +++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)

---
base-commit: f2fbb908112311423b09cd0d2b4978f174b99585
change-id: 20231026-fix-check-stack-write-c40996694dfa

Best regards,

Signature · 1 line
Hao Sun <[email protected]>