]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Remove mark_precise_scalar_ids()
authorEduard Zingerman <eddyz87@gmail.com>
Thu, 18 Jul 2024 20:23:54 +0000 (13:23 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 29 Jul 2024 19:53:14 +0000 (12:53 -0700)
commit842edb5507a1038e009d27e69d13b94b6f085763
treefe7494a4a1c2c2191a88a907a1d0473ea0dc9fbb
parent4bf79f9be434e000c8e12fe83b2f4402480f1460
bpf: Remove mark_precise_scalar_ids()

Function mark_precise_scalar_ids() is superseded by
bt_sync_linked_regs() and equal scalars tracking in jump history.
mark_precise_scalar_ids() propagates precision over registers sharing
same ID on parent/child state boundaries, while jump history records
allow bt_sync_linked_regs() to propagate same information with
instruction level granularity, which is strictly more precise.

This commit removes mark_precise_scalar_ids() and updates test cases
in progs/verifier_scalar_ids to reflect new verifier behavior.

The tests are updated in the following manner:
- mark_precise_scalar_ids() propagated precision regardless of
  presence of conditional jumps, while new jump history based logic
  only kicks in when conditional jumps are present.
  Hence test cases are augmented with conditional jumps to still
  trigger precision propagation.
- As equal scalars tracking no longer relies on parent/child state
  boundaries some test cases are no longer interesting,
  such test cases are removed, namely:
  - precision_same_state and precision_cross_state are superseded by
    linked_regs_bpf_k;
  - precision_same_state_broken_link and equal_scalars_broken_link
    are superseded by linked_regs_broken_link.

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