Fix stale register bounds on LSM retval context load
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
- v3 Latest2 patches 2 repliesApplied 2/2
- v21 patch 1 replySuperseded
- v11 patch 1 replySuperseded
Changes in v3 from the cover letter
- Add selftest demonstrating the issue (Eduard Zingerman)
- No code change in patch 1 from v2
Patches in v3 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: Reset register bounds before narrowing retval range in check_mem_access()kernel/ | +1 | 1 reply | Applied |
| 2/2 | selftests/bpf: Add test for stale bounds on LSM retval context loadtools/ | +15 | 1 reply | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Eduard Zingerman |
|---|---|
| 1/2 | A-b |
| 2/2 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf v3 0/2] Fix stale register bounds on LSM retval context load
From: Tristan Madani <[email protected]>
check_mem_access() calls __mark_reg_s32_range() to narrow a register to the LSM hook retval range, but the intersection preserves stale bounds from prior instructions. Add mark_reg_unknown() before narrowing (same pattern as the else branch) and a selftest that catches the mismatch.
Changes in v3:
- Add selftest demonstrating the issue (Eduard Zingerman)
- No code change in patch 1 from v2
Tristan Madani (2):
bpf: Reset register bounds before narrowing retval range in
check_mem_access()
selftests/bpf: Add test for stale bounds on LSM retval context load
kernel/bpf/verifier.c | 1 + tools/testing/selftests/bpf/progs/verifier_lsm.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+)
Signature · 1 line
2.47.3