]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: Tests for per-insn sync_linked_regs() precision tracking
authorEduard Zingerman <eddyz87@gmail.com>
Thu, 18 Jul 2024 20:23:55 +0000 (13:23 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 29 Jul 2024 19:53:17 +0000 (12:53 -0700)
commitbebc17b1c03b224a0b4aec6a171815e39f8ba9bc
tree9b4e4b69695230e9207e420e2580d386108d3eb7
parent842edb5507a1038e009d27e69d13b94b6f085763
selftests/bpf: Tests for per-insn sync_linked_regs() precision tracking

Add a few test cases to verify precision tracking for scalars gaining
range because of sync_linked_regs():
- check what happens when more than 6 registers might gain range in
  sync_linked_regs();
- check if precision is propagated correctly when operand of
  conditional jump gained range in sync_linked_regs() and one of
  linked registers is marked precise;
- check if precision is propagated correctly when operand of
  conditional jump gained range in sync_linked_regs() and a
  other-linked operand of the conditional jump is marked precise;
- add a minimized reproducer for precision tracking bug reported in [0];
- Check that mark_chain_precision() for one of the conditional jump
  operands does not trigger equal scalars precision propagation.

[0] https://lore.kernel.org/bpf/CAEf4BzZ0xidVCqB47XnkXcNhkPWF6_nTV7yt+_Lf0kcFEut2Mg@mail.gmail.com/

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240718202357.1746514-4-eddyz87@gmail.com
tools/testing/selftests/bpf/progs/verifier_scalar_ids.c