All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf 0/2] bpf: Keep fastcall stack slots for helper stack reads
@ 2026-06-24  8:39 Nuoqi Gui
  2026-06-24  8:39 ` [PATCH bpf 1/2] bpf: Keep fastcall spills " Nuoqi Gui
  2026-06-24  8:39 ` [PATCH bpf 2/2] selftests/bpf: Cover fastcall " Nuoqi Gui
  0 siblings, 2 replies; 5+ messages in thread
From: Nuoqi Gui @ 2026-06-24  8:39 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Eduard Zingerman, Kumar Kartikeya Dwivedi
  Cc: John Fastabend, Martin KaFai Lau, Shuah Khan, bpf,
	linux-kselftest, linux-kernel, Nuoqi Gui

Fastcall spill/fill elision is guarded by a stack contract: stack slots in
the pattern may only be accessed by the pattern itself. Direct stack loads
and stores enforce that contract, but helper and kfunc memory arguments can
read from PTR_TO_STACK through check_stack_range_initialized() without
disabling the post-verification elision.

Make helper/kfunc stack memory checks enforce the fastcall contract after
resolving the range. Add a verifier selftest for a read-only helper access
through bpf_csum_diff().

Fixes: 5b5f51bff1b66 ("bpf: no_caller_saved_registers attribute for helper calls")

Signed-off-by: Nuoqi Gui <gnq25@mails.tsinghua.edu.cn>
---
Nuoqi Gui (2):
      bpf: Keep fastcall spills for helper stack reads
      selftests/bpf: Cover fastcall helper stack reads

 kernel/bpf/verifier.c                              |  4 +++
 .../selftests/bpf/progs/verifier_bpf_fastcall.c    | 32 ++++++++++++++++++++++
 2 files changed, 36 insertions(+)
---
base-commit: 76f62d237538b456354a44e796a541cde03c6e28
change-id: 20260624-f01-12-fastcall-helper-stack-read-6d4dc1ffb513

Best regards,
--  
Nuoqi Gui <gnq25@mails.tsinghua.edu.cn>


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

end of thread, other threads:[~2026-06-24 10:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24  8:39 [PATCH bpf 0/2] bpf: Keep fastcall stack slots for helper stack reads Nuoqi Gui
2026-06-24  8:39 ` [PATCH bpf 1/2] bpf: Keep fastcall spills " Nuoqi Gui
2026-06-24  9:04   ` sashiko-bot
2026-06-24  8:39 ` [PATCH bpf 2/2] selftests/bpf: Cover fastcall " Nuoqi Gui
2026-06-24 10:01   ` bot+bpf-ci

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.