[PATCH bpf-next v4 0/2] bpf: Skip bounds adjustment for conditional jumps on same scalar register

From: KaFai Wan
Date: Mon Nov 03 2025 - 01:32:36 EST


This small patchset is about avoid verifier bug warning when conditional
jumps on same register when the register holds a scalar with range.

v4:
- make code better. (Alexei)

v3:
https://lore.kernel.org/bpf/20251031154107.403054-1-kafai.wan@xxxxxxxxx/
- Enhance is_scalar_branch_taken() to handle scalar case. (Eduard)
- Update the selftest to cover all conditional jump opcodes. (Eduard)

v2:
https://lore.kernel.org/bpf/20251025053017.2308823-1-kafai.wan@xxxxxxxxx/
- Enhance is_branch_taken() and is_scalar_branch_taken() to handle
branch direction computation for same register. (Eduard and Alexei)
- Update the selftest.


v1:
https://lore.kernel.org/bpf/20251022164457.1203756-1-kafai.wan@xxxxxxxxx/
---
KaFai Wan (2):
bpf: Skip bounds adjustment for conditional jumps on same scalar
register
selftests/bpf: Add test for conditional jumps on same scalar register

kernel/bpf/verifier.c | 31 ++++
.../selftests/bpf/progs/verifier_bounds.c | 154 ++++++++++++++++++
2 files changed, 185 insertions(+)

--
2.43.0