linux/tools/testing
Puranjay Mohan 7a433e5193 bpf: Support negative offsets, BPF_SUB, and alu32 for linked register tracking
Previously, the verifier only tracked positive constant deltas between
linked registers using BPF_ADD. This limitation meant patterns like:

  r1 = r0;
  r1 += -4;
  if r1 s>= 0 goto l0_%=;   // r1 >= 0 implies r0 >= 4
  // verifier couldn't propagate bounds back to r0
  if r0 != 0 goto l0_%=;
	r0 /= 0; // Verifier thinks this is reachable
  l0_%=:

Similar limitation exists for 32-bit registers.

With this change, the verifier can now track negative deltas in reg->off
enabling bound propagation for the above pattern.

For alu32, we make sure the destination register has the upper 32 bits
as 0s before creating the link. BPF_ADD_CONST is split into
BPF_ADD_CONST64 and BPF_ADD_CONST32, the latter is used in case of alu32
and sync_linked_regs uses this to zext the result if known_reg has this
flag.

Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20260204151741.2678118-2-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-02-04 13:35:28 -08:00
..
crypto/chacha20-s390 crypto: lib/chacha - strongly type the ChaCha state 2025-05-12 13:32:53 +08:00
cxl Merge branch 'for-6.19/cxl-misc' into cxl-for-next 2025-11-18 16:27:58 -07:00
fault-injection
ktest ktest.pl: Fix uninitialized var in config-bisect.pl 2025-12-03 18:25:18 -05:00
kunit kunit: qemu_configs: Add MIPS configurations 2025-09-15 10:30:07 -06:00
memblock memblock: add MEMBLOCK_RSRV_KERN flag 2025-05-12 23:50:38 -07:00
nvdimm tools/testing/nvdimm: Use per-DIMM device handle 2025-11-03 16:47:13 -06:00
radix-tree idr: fix idr_alloc() returning an ID out of range 2025-12-23 11:23:11 -08:00
rbtree
scatterlist mm: remove nth_page() 2025-09-21 14:22:10 -07:00
selftests bpf: Support negative offsets, BPF_SUB, and alu32 for linked register tracking 2026-02-04 13:35:28 -08:00
shared Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
vma mm: introduce VMA flags bitmap type 2025-11-29 10:41:09 -08:00
vsock vsock/test: Test setting SO_ZEROCOPY on accept()ed socket 2026-01-05 16:14:51 -08:00