public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: Fix verifier_bug_if to account for BPF_CALL
@ 2026-01-27 11:59 Luis Gerhorst
  2026-01-27 11:59 ` [PATCH bpf-next 1/2] " Luis Gerhorst
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Luis Gerhorst @ 2026-01-27 11:59 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
	Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
	Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Shuah Khan, Luis Gerhorst, Ihor Solodrai, Kumar Kartikeya Dwivedi,
	bpf, linux-kernel, linux-kselftest

This fixes the verifier_bug_if() that runs on nospec_result to not trigger
for BPF_CALL (bug reported by Hu, Mei, and Mu). See patch 1 for a full
description and patch 2 for a test (based on the PoC from the report).

While working on this I noticed two other problems:

- nospec_result is currently ignored for BPF_CALL during patching, but it
  may be required if we assume the CPU may speculate into/out of functions.

- Both the instruction patching for nospec and nospec_result erases the
  instruction aux information even thought it might be better to keep that.
  For nospec_result it may be fine as it is only applied to store
  instructions currently (except for when we decide to change the thing
  from above), but nospec may be set for arbitrary instructions and if
  these require rewrites they break.

I assume these issues are better fixed separately, thus I decided to
exclude them from this series.

Luis Gerhorst (2):
  bpf: Fix verifier_bug_if to account for BPF_CALL
  bpf: Test nospec after dead stack write in helper

 kernel/bpf/verifier.c                         | 14 +++++++-----
 .../selftests/bpf/progs/verifier_unpriv.c     | 22 +++++++++++++++++++
 2 files changed, 30 insertions(+), 6 deletions(-)


base-commit: 8016abd6314ed1ed01ff09404e3c82ceb13c185b
-- 
2.52.0


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

end of thread, other threads:[~2026-01-29  2:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-27 11:59 [PATCH bpf-next 0/2] bpf: Fix verifier_bug_if to account for BPF_CALL Luis Gerhorst
2026-01-27 11:59 ` [PATCH bpf-next 1/2] " Luis Gerhorst
2026-01-27 11:59 ` [PATCH bpf-next 2/2] bpf: Test nospec after dead stack write in helper Luis Gerhorst
2026-01-27 12:37 ` [PATCH bpf-next 0/2] bpf: Fix verifier_bug_if to account for BPF_CALL Luis Gerhorst
2026-01-29  2:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox