All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf v3 0/2] Fix stale register bounds on LSM retval context load
@ 2026-06-22 23:01 Tristan Madani
  2026-06-22 23:01 ` [PATCH bpf v3 1/2] bpf: Reset register bounds before narrowing retval range in check_mem_access() Tristan Madani
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tristan Madani @ 2026-06-22 23:01 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: Eduard Zingerman, Xu Kuohai, Jiri Olsa, John Fastabend,
	Martin KaFai Lau, bpf, stable, tristan

From: Tristan Madani <tristan@talencesecurity.com>

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(+)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-06-23  0:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22 23:01 [PATCH bpf v3 0/2] Fix stale register bounds on LSM retval context load Tristan Madani
2026-06-22 23:01 ` [PATCH bpf v3 1/2] bpf: Reset register bounds before narrowing retval range in check_mem_access() Tristan Madani
2026-06-22 23:48   ` bot+bpf-ci
2026-06-23  0:07   ` Eduard Zingerman
2026-06-22 23:01 ` [PATCH bpf v3 2/2] selftests/bpf: Add test for stale bounds on LSM retval context load Tristan Madani
2026-06-23  0:08   ` Eduard Zingerman
2026-06-23  0:30 ` [PATCH bpf v3 0/2] Fix stale register " patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.