mirror-linux/tools/testing/selftests
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
..
acct selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
alsa Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
amd-pstate
arm64 Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
bpf bpf: Support negative offsets, BPF_SUB, and alu32 for linked register tracking 2026-02-04 13:35:28 -08:00
breakpoints selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
cachestat selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
capabilities selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
cgroup Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
clone3 selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
connector selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
core selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
coredump Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
cpu-hotplug
cpufreq
damon selftests/damon/sysfs.py: merge DAMON status dumping into commitment assertion 2025-11-20 13:44:01 -08:00
devices
dmabuf-heaps selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
drivers selftests: netdevsim: add carrier state consistency test 2026-01-06 18:04:01 -08:00
dt
efivarfs
exec selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
fchmodat2 selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
filelock selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
filesystems Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
firmware
fpu
ftrace selftests/tracing: Fix test_multiple_writes stall 2026-01-09 15:49:32 -07:00
futex Futex changes for v6.19: 2025-12-10 17:21:30 +09:00
gpio
hid HID: Use bpf_wq_set_callback kernel function 2026-01-20 16:15:57 -08:00
ia64
intel_pstate selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
iommu iommufd/selftest: Make it clearer to gcc that the access is not out of bounds 2025-12-15 20:34:41 -04:00
ipc selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
ir selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
kcmp selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
kexec selftests/kexec: Ignore selftest binary 2025-09-25 13:43:28 -06:00
kho kho: make debugfs interface optional 2025-11-27 14:24:31 -08:00
kmod
kselftest selftests/run_kselftest.sh: exit with error if tests fail 2025-11-19 15:00:22 -07:00
kselftest_harness selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
kvm selftests: kvm: Verify TILELOADD actually #NM faults when XFD[18]=1 2026-01-10 07:17:30 +01:00
landlock Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
lib
livepatch selftests: livepatch: use canonical ftrace path 2025-10-15 14:50:46 +02:00
liveupdate selftests/liveupdate: add kexec test for multiple and empty sessions 2025-11-27 14:24:42 -08:00
lkdtm lkdtm/bugs: Add cases for BUG and PANIC occurring in hardirq context 2025-12-15 12:05:37 +00:00
locking
lsm selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
media_tests selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
membarrier selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
memfd
memory-hotplug
mincore selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
mm selftests/mm: fix thread state check in uffd-unit-tests 2025-12-23 11:23:14 -08:00
module
mount
mount_setattr selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
move_mount_set_group selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
mqueue selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
mseal_system_mappings selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
namespaces Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
nci selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
net selftests: drv-net: Bring back tool() to driver __init__s 2026-01-06 17:52:08 -08:00
nolibc nolibc changes for v6.19 2025-12-03 09:23:25 -08:00
ntb
openat2 selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
pci_endpoint selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
pcie_bwctrl
perf_events selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
pid_namespace selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
pidfd Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
power_supply
powerpc selftests/powerpc/pmu/: Add check_extended_reg_test to .gitignore 2025-12-22 17:55:07 +05:30
prctl selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
proc selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
pstore
ptp
ptrace selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
rcutorture Merge branch 'rcu/misc' into next 2025-11-30 22:20:33 +01:00
resctrl selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
ring-buffer selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
riscv Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
rlimits
rseq Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
rtc selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
rust
safesetid
sched
sched_ext selftests/sched_ext: flush stdout before test to avoid log spam 2025-12-12 08:18:32 -10:00
seccomp selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
sgx selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
signal selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
size
sparc64 selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
splice
static_keys
sync selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
syscall_user_dispatch selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
sysctl
tc-testing selftests/tc-testing: Add test case redirecting to self on egress 2026-01-05 16:23:43 -08:00
tdx selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
thermal/intel
timens selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
timers Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
tmpfs selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
tpm2 selftests: tpm2: Fix ill defined assertions 2025-12-03 22:55:27 +02:00
tty TTY/Serial changes for 6.19-rc1 2025-12-06 18:38:19 -08:00
turbostat
ublk selftests/ublk: fix Makefile to rebuild on header changes 2025-12-28 09:25:26 -07:00
uevent selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
user_events selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
vDSO Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
verification selftests/verification: Add initial RV tests 2025-11-11 13:18:55 +01:00
vfio vfio: selftests: Drop <uapi/linux/types.h> includes 2025-12-23 14:17:13 -07:00
vsock selftests/vsock: disable shellcheck SC2317 and SC2119 2025-11-12 06:19:40 -08:00
watchdog
wireguard hung_task: panic when there are more than N hung tasks at the same time 2025-11-12 10:00:14 -08:00
x86 Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
zram mm: remove unused zpool layer 2025-09-21 14:21:59 -07:00
.gitignore
Makefile selftests/liveupdate: add userspace API selftests 2025-11-27 14:24:41 -08:00
gen_kselftest_tar.sh
kselftest.h Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
kselftest_deps.sh
kselftest_harness.h kselftest/harness: Use helper to avoid zero-size memset warning 2025-12-31 13:27:36 -07:00
kselftest_install.sh
kselftest_module.h
lib.mk selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
run_kselftest.sh selftests/run_kselftest.sh: exit with error if tests fail 2025-11-19 15:00:22 -07:00