Merge branch 'bpf-verifier-improve-precision-of-bpf_add-and-bpf_sub'
authorAlexei Starovoitov <ast@kernel.org>
Wed, 25 Jun 2025 01:37:22 +0000 (18:37 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 25 Jun 2025 01:48:39 +0000 (18:48 -0700)
commit3713b584dabb1f34a31f33e6a956df00ad8bcc65
treeafb517bfdca6a0e299b11bfa2eb6a7b9b16fc17a
parent3ce7cdde66e65a400b2d1b2a7f72c499e1db26b6
parente1d794541b3f17c37f66d4134ee7c044fac4dc87
Merge branch 'bpf-verifier-improve-precision-of-bpf_add-and-bpf_sub'

Harishankar Vishwanathan says:

====================
bpf, verifier: Improve precision of BPF_ADD and BPF_SUB

This patchset improves the precision of BPF_ADD and BPF_SUB range
tracking. It also adds selftests that exercise the cases where precision
improvement occurs, and selftests for the cases where precise bounds
cannot be computed and the output register state values are set to
unbounded.

Changelog:

v3:
* Improve readability in selftests and commit message by using
  more readable constants (suggested by Eduard Zingerman).
* Add four new selftests for the cases where precise output register
  state bounds cannot be computed in scalar(32)_min_max_add/sub, so the
  output register state must be set to unbounded, i.e., [0, U64_MAX]
  or [0, U32_MAX].
* Add suggested-by Eduard tag to commit message for changes to
  verifier_bounds.c

v2:
* Add clearer example of precision improvement in the commit message for
  verifier.c changes.
* Add selftests that exercise the precision improvement to
  verifier_bounds.c (suggested by Eduard Zingerman).

v1:
  https://lore.kernel.org/bpf/20250610221356.2663491-1-harishankar.vishwanathan@gmail.com/
====================

Link: https://patch.msgid.link/20250623040359.343235-1-harishankar.vishwanathan@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>