BPF verifier state equivalence checks improvements
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest7 patches 8 repliesIn review 6 of 7 applied
Patches in v1 6 of 7 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | bpf: teach refsafe() to take into account ID remappingkernel/ | +12 | 0 replies | Applied |
| 2/7 | bpf: reorganize struct bpf_reg_state fieldsinclude/ kernel/ | +28 | 0 replies | Applied |
| 3/7 | bpf: generalize MAYBE_NULL vs non-MAYBE_NULL rulekernel/ | +15 | 0 replies | Applied |
| 4/7 | bpf: reject non-exact register type matches in regsafe()kernel/ | +21 | 0 replies | Applied |
| 5/7 | bpf: perform byte-by-byte comparison only when necessary in regsafe()kernel/ | +9 | 0 replies | Applied |
| 6/7 | bpf: fix regs_exact() logic in regsafe() to remap IDs correctlykernel/ | +16 | 0 replies | Applied |
| 7/7 | bpf: unify PTR_TO_MAP_{KEY,VALUE} with default case in regsafe()kernel/ | +14 | 8 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH bpf-next 0/7] BPF verifier state equivalence checks improvements
This patch set fixes, improves, and refactors parts of BPF verifier's state equivalence checks.
Patch #1 fixes refsafe(), making it take into account ID map when comparing reference IDs. See patch for details.
Patches #2-#7 refactor regsafe() function which compares two register states across old and current states. regsafe() is critical piece of logic, so to make it easier to review and validate refactorings and logic fixes and improvements, each patch makes a small change, explaining why the change is correct and makes sense. Please see individual patches for details.
This patch set is one of the preliminaries required for upcoming BPF open-coded iterators, as with open-coded iterators verifier's loop safety and completion proof is critically dependent on correct state equivalence logic.
Andrii Nakryiko (7):
bpf: teach refsafe() to take into account ID remapping
bpf: reorganize struct bpf_reg_state fields
bpf: generalize MAYBE_NULL vs non-MAYBE_NULL rule
bpf: reject non-exact register type matches in regsafe()
bpf: perform byte-by-byte comparison only when necessary in regsafe()
bpf: fix regs_exact() logic in regsafe() to remap IDs correctly
bpf: unify PTR_TO_MAP_{KEY,VALUE} with default case in regsafe()
include/linux/bpf_verifier.h | 40 +++++----- kernel/bpf/verifier.c | 151 +++++++++++++++++++---------------- 2 files changed, 101 insertions(+), 90 deletions(-)
Signature · 1 line
2.30.2