bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/4] bpf: Improve 64bits bounds refinement
@ 2025-07-19 14:20 Paul Chaignon
  2025-07-19 14:22 ` [PATCH bpf-next 1/4] bpf: Improve bounds when s64 crosses sign boundary Paul Chaignon
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Paul Chaignon @ 2025-07-19 14:20 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Eduard Zingerman, Yonghong Song

This patchset improves the 64bits bounds refinement when the s64 ranges
crosses the sign boundary. The first patch explains the small addition
to __reg64_deduce_bounds. The third patch adds a selftest with a more
complete example of the impact on verification. The second and last
patches update the existing selftests to take the new refinement into
account.

This patchset should reduce the number of kernel warnings hit by
syzkaller due to invariant violations [1]. It was also tested with
Agni [2] (and Cilium's CI for good measure).

Link: https://syzkaller.appspot.com/bug?extid=c711ce17dd78e5d4fdcf [1]
Link: https://github.com/bpfverif/agni [2]

Paul Chaignon (4):
  bpf: Improve bounds when s64 crosses sign boundary
  selftests/bpf: Update reg_bound range refinement logic
  selftests/bpf: Test cross-sign 64bits range refinement
  selftests/bpf: Test invariants on JSLT crossing sign

 kernel/bpf/verifier.c                         | 44 +++++++++++++++++++
 .../selftests/bpf/prog_tests/reg_bounds.c     | 14 ++++++
 .../selftests/bpf/progs/verifier_bounds.c     | 25 ++++++++++-
 3 files changed, 82 insertions(+), 1 deletion(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-07-24 14:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-19 14:20 [PATCH bpf-next 0/4] bpf: Improve 64bits bounds refinement Paul Chaignon
2025-07-19 14:22 ` [PATCH bpf-next 1/4] bpf: Improve bounds when s64 crosses sign boundary Paul Chaignon
2025-07-21 21:29   ` Eduard Zingerman
2025-07-22  7:32   ` Shung-Hsi Yu
2025-07-22 22:09     ` Paul Chaignon
2025-07-23  7:49       ` Shung-Hsi Yu
2025-07-19 14:22 ` [PATCH bpf-next 2/4] selftests/bpf: Update reg_bound range refinement logic Paul Chaignon
2025-07-21 21:29   ` Eduard Zingerman
2025-07-22 21:20     ` Paul Chaignon
2025-07-22 21:26       ` Eduard Zingerman
2025-07-19 14:23 ` [PATCH bpf-next 3/4] selftests/bpf: Test cross-sign 64bits range refinement Paul Chaignon
2025-07-21 21:30   ` Eduard Zingerman
2025-07-24 14:03     ` Paul Chaignon
2025-07-19 14:24 ` [PATCH bpf-next 4/4] selftests/bpf: Test invariants on JSLT crossing sign Paul Chaignon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).