mirror-linux/include
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
..
acpi ACPI: PCI: IRQ: Fix INTx GSIs signedness 2026-01-05 19:06:40 +01:00
asm-generic rqspinlock: Fix TAS fallback lock entry creation 2026-01-23 10:03:49 -08:00
clocksource
crypto
cxl
drm drm-misc-fixes for v6.19-rc5: 2026-01-08 07:41:00 +10:00
dt-bindings This pull request is entirely SoC clk drivers, not for lack of trying to modify 2025-12-08 09:38:52 +09:00
hyperv hyperv: Avoid -Wflex-array-member-not-at-end warning 2025-12-18 19:42:01 +00:00
keys
kunit kunit: Enforce task execution in {soft,hard}irq contexts 2025-12-22 12:20:08 -08:00
kvm
linux bpf: Support negative offsets, BPF_SUB, and alu32 for linked register tracking 2026-02-04 13:35:28 -08:00
math-emu
media
memory
misc
net net: dsa: properly keep track of conduit reference 2025-12-23 10:32:08 +01:00
pcmcia
ras
rdma
rv
scsi
soc This pull request is entirely SoC clk drivers, not for lack of trying to modify 2025-12-08 09:38:52 +09:00
sound ASoC: soc-acpi / SOF: Add best_effort flag to get_function_tplg_files op 2025-12-15 23:08:35 +09:00
target
trace nfsd-6.19 fixes: 2026-01-06 09:12:52 -08:00
uapi bpf: add new BPF_CGROUP_ITER_CHILDREN control option 2026-01-27 09:05:54 -08:00
ufs
vdso
video
xen
Kbuild