mirror-linux/tools/testing/selftests
Jiayuan Chen 04013c3ca0 selftests/bpf: Add tests for sock_ops ctx access with same src/dst register
Add selftests to verify SOCK_OPS_GET_SK() and SOCK_OPS_GET_FIELD() correctly
return NULL/zero when dst_reg == src_reg and is_fullsock == 0.

Three subtests are included:
 - get_sk: ctx->sk with same src/dst register (SOCK_OPS_GET_SK)
 - get_field: ctx->snd_cwnd with same src/dst register (SOCK_OPS_GET_FIELD)
 - get_sk_diff_reg: ctx->sk with different src/dst register (baseline)

Each BPF program uses inline asm (__naked) to force specific register
allocation, reads is_fullsock first, then loads the field using the same
(or different) register. The test triggers TCP_NEW_SYN_RECV via a TCP
handshake and checks that the result is NULL/zero when is_fullsock == 0.

Reviewed-by: Sun Jian <sun.jian.kdev@gmail.com>
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20260407022720.162151-3-jiayuan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-04-12 12:28:05 -07:00
..
acct
alsa selftests: ALSA: Remove unused variable in utimer-test 2026-01-19 09:12:59 +01:00
amd-pstate
arm64 selftest/arm64: Fix sve2p1_sigill() to hwcap test 2026-03-06 11:54:26 +00:00
bpf selftests/bpf: Add tests for sock_ops ctx access with same src/dst register 2026-04-12 12:28:05 -07:00
breakpoints
cachestat
capabilities
cgroup selftests/cgroup: Don't require synchronous populated update on task exit 2026-03-24 10:21:57 -10:00
clone3
connector
core
coredump kselftest/coredump: use __builtin_trap() instead of null pointer 2025-12-31 10:49:57 -07:00
cpu-hotplug
cpufreq
damon selftests/damon/wss_estimation: deduplicate failed samples output 2026-01-31 14:22:45 -08:00
devices
dm-verity selftests: add dm-verity keyring selftests 2026-01-19 15:21:26 +01:00
dmabuf-heaps
drivers selftests: Add MACsec VLAN propagation traffic test 2026-04-09 19:38:42 -07:00
dt
efivarfs
exec
fchmodat2
filelock
filesystems selftests: fix mntns iteration selftests 2026-02-27 22:00:11 +01:00
firmware
fpu
ftrace selftests/tracing: Fix test_multiple_writes stall 2026-01-09 15:49:32 -07:00
futex
gpio
hid selftests/hid: fix compilation when bpf_wq and hid_device are not exported 2026-03-16 16:21:06 +01:00
ia64
intel_pstate
iommu
ipc
ir
kcmp
kexec
kho
kmod
kselftest
kselftest_harness
kvm KVM: s390: Fixes for 7.0 2026-03-24 17:32:13 +01:00
landlock selftests/landlock: Test tsync interruption and cancellation paths 2026-03-19 20:57:39 +01:00
lib
livepatch
liveupdate
lkdtm lkdtm/bugs: Add __counted_by_ptr() test PTR_BOUNDS 2026-01-17 11:00:37 -08:00
locking
lsm
media_tests
membarrier
memfd selftests/memfd: use IPC semaphore instead of SIGSTOP/SIGCONT 2026-02-12 15:45:57 -08:00
memory-hotplug
mincore
mm mm.git review status for linus..mm-stable 2026-02-18 20:50:32 -08:00
module
mount
mount_setattr selftests/mount_setattr: increase tmpfs size for idmapped mount tests 2026-03-17 16:59:45 +01:00
move_mount_set_group
mqueue
mseal_system_mappings
namespaces
nci
net selftests: nft_queue.sh: add a parallel stress test 2026-04-08 13:34:51 +02:00
nolibc tools/nolibc: Add a simple test for writing to a FILE and reading it back 2026-01-11 12:47:47 +01:00
ntb
openat2
pci_endpoint selftests: pci_endpoint: Add BAR subrange mapping test case 2026-01-29 17:42:37 -06:00
pcie_bwctrl
perf_events
pid_namespace
pidfd selftests/pidfd: fix typo in comment 2026-01-21 10:56:25 -07:00
power_supply
powerpc powerpc/selftests/copyloops: extend selftest to exercise __copy_tofrom_user_power7_vmx 2026-03-12 11:03:48 +05:30
prctl
proc
pstore
ptp selftests: ptp: treat unsupported PHC operations as skip 2026-01-27 17:57:28 -08:00
ptrace
rcutorture scftorture: Update due to x86 not supporting none/voluntary preemption 2026-03-05 13:11:10 -08:00
resctrl selftests/resctrl: Fix non-contiguous CBM check for Hygon 2026-01-09 16:49:01 -07:00
ring-buffer
riscv selftests: riscv: Add braces around EXPECT_EQ() 2026-04-04 18:37:57 -06:00
rlimits
rseq selftests/rseq: Add rseq slice histogram script 2026-01-22 11:11:20 +01:00
rtc
rust
safesetid
sched
sched_ext selftests/sched_ext: Add cyclic SCX_KICK_WAIT stress test 2026-03-30 08:37:55 -10:00
seccomp
sgx
signal
size
sparc64
splice
static_keys
sync
syscall_user_dispatch
sysctl
tc-testing selftests/tc-testing: add tests for cls_fw and cls_flow on shared blocks 2026-04-02 15:08:42 +02:00
tdx
thermal/intel thermal: intel: selftests: workload_hint: Support slow workload hints 2026-01-07 21:42:10 +01:00
timens
timers
tmpfs
tpm2
tty
turbostat
ublk for-7.0/block-20260206 2026-02-09 17:57:21 -08:00
uevent
user_events
vDSO * VDSO rework and cleanups 2026-02-10 19:34:26 -08:00
verification
vfio vfio: selftests: only build tests on arm64 and x86_64 2026-02-06 15:08:05 -07:00
vsock selftests/vsock: change tests to respect write-once child ns mode 2026-02-26 11:10:03 +01:00
watchdog
wireguard watchdog: softlockup: panic when lockup duration exceeds N thresholds 2026-01-20 19:44:20 -08:00
x86 selftests/x86: Clean up sysret_rip coding style 2026-01-19 12:06:11 +01:00
zram
.gitignore
Makefile netconsole: selftests: Move netconsole selftests to separate target 2026-01-29 17:30:48 -08:00
gen_kselftest_tar.sh
kselftest.h
kselftest_deps.sh
kselftest_harness.h selftests/harness: order TEST_F and XFAIL_ADD constructors 2026-03-05 07:34:54 -08:00
kselftest_install.sh
kselftest_module.h
lib.mk
run_kselftest.sh selftests/run_kselftest.sh: Add `--skip` argument option 2026-01-16 13:46:40 -07:00