linux-kernelorg-stable/tools/testing/selftests
Luis Gerhorst cf15cdc0f0 selftests/bpf: Fix caps for __xlated/jited_unpriv
Currently, __xlated_unpriv and __jited_unpriv do not work because the
BPF syscall will overwrite info.jited_prog_len and info.xlated_prog_len
with 0 if the process is not bpf_capable(). This bug was not noticed
before, because there is no test that actually uses
__xlated_unpriv/__jited_unpriv.

To resolve this, simply restore the capabilities earlier (but still
after loading the program). Adding this here unconditionally is fine
because the function first checks that the capabilities were initialized
before attempting to restore them.

This will be important later when we add tests that check whether a
speculation barrier was inserted in the correct location.

Signed-off-by: Luis Gerhorst <luis.gerhorst@fau.de>
Fixes: 9c9f733913 ("selftests/bpf: allow checking xlated programs in verifier_* tests")
Fixes: 7d743e4c75 ("selftests/bpf: __jited test tag to check disassembly after jit")
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Tested-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20250501073603.1402960-2-luis.gerhorst@fau.de
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2025-05-09 11:29:11 -07:00
..
acct
alsa
amd-pstate
arm64 CRC updates for 6.15 2025-03-25 18:33:04 -07:00
bpf selftests/bpf: Fix caps for __xlated/jited_unpriv 2025-05-09 11:29:11 -07:00
breakpoints
cachestat
capabilities
cgroup selftest/cgroup: Add a remote partition transition test to test_cpuset_prs.sh 2025-03-31 13:28:19 -10:00
clone3 selftests/pidfd: fixes syscall number defines 2025-03-25 14:59:05 +01:00
connector
core
coredump
cpu-hotplug
cpufreq
damon selftests/damon/damon_nr_regions: sort collected regiosn before checking with min/max boundaries 2025-03-05 21:36:16 -08:00
devices
dma
dmabuf-heaps
drivers io_uring/zcrx: enable tcp-data-split in selftest 2025-04-10 17:27:58 -07:00
dt
efivarfs
exec
fchmodat2
filelock
filesystems SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
firmware
fpu
ftrace tracing fixes for v6.15 2025-04-19 11:57:36 -07:00
futex selftests/futex: futex_waitv wouldblock test should fail 2025-04-08 16:50:19 -06:00
gpio
hid lib/crc: remove unnecessary prompt for CONFIG_CRC_T10DIF 2025-04-04 11:31:42 -07:00
ia64
intel_pstate
iommu iommufd: Test attach before detaching pasid 2025-03-28 11:40:41 -03:00
ipc
ir
kcmp
kexec
kmod
kselftest printf: convert self-test to KUnit 2025-03-13 10:26:33 -07:00
kvm ARM: 2025-04-08 13:47:55 -07:00
landlock selftests/landlock: Add PID tests for audit records 2025-04-11 12:53:22 +02:00
lib lib/prime_numbers: KUnit test should not select PRIME_NUMBERS 2025-04-15 13:50:43 -07:00
livepatch Livepatching changes for 6.15 2025-03-27 19:26:10 -07:00
lkdtm
locking
lsm
media_tests
membarrier
memfd
memory-hotplug
mincore 31 hotfixes. 9 are cc:stable and the remainder address post-6.15 issues 2025-04-16 20:07:32 -07:00
mm selftests/mm: fix compiler -Wmaybe-uninitialized warning 2025-04-11 17:32:41 -07:00
module
mount
mount_setattr selftests: test subdirectory mounting 2025-03-04 09:29:55 +01:00
move_mount_set_group
mqueue
mseal_system_mappings selftest: test system mappings are sealed 2025-04-01 15:17:16 -07:00
nci
net selftests: mptcp: diag: use mptcp_lib_get_info_value 2025-04-23 16:27:58 -07:00
nolibc selftests/nolibc: stop testing constructor order 2025-03-07 07:34:12 +01:00
ntb
openat2
pci_endpoint misc: pci_endpoint_test: Add support for PCITEST_IRQ_TYPE_AUTO 2025-03-26 06:11:54 +00:00
pcie_bwctrl selftests/pcie_bwctrl: Fix test progs list 2025-04-18 08:23:22 -05:00
perf_events
pid_namespace
pidfd selftests/pidfd: fixes syscall number defines 2025-03-25 14:59:05 +01:00
power_supply
powerpc powerpc updates for 6.15 2025-03-27 19:39:08 -07:00
prctl
proc
pstore
ptp testptp: Add option to open PHC in readonly mode 2025-03-05 12:43:54 +00:00
ptrace
rcutorture Merge branches 'docs.2025.02.04a', 'lazypreempt.2025.03.04a', 'misc.2025.03.04a', 'srcu.2025.02.05a' and 'torture.2025.02.05a' 2025-03-04 18:47:32 -08:00
resctrl
ring-buffer
riscv selftests: riscv: fix v_exec_initval_nolibc.c 2025-04-01 07:03:04 +00:00
rlimits
rseq rseq/selftests: Fix namespace collision with rseq UAPI header 2025-03-19 21:26:24 +01:00
rtc rtc: remove 'setdate' test program 2025-04-01 15:25:15 +02:00
rust
safesetid
sched sched/debug: Remove CONFIG_SCHED_DEBUG from self-test config files 2025-03-19 22:23:24 +01:00
sched_ext Scheduler updates for v6.15: 2025-03-24 21:28:12 -07:00
seccomp
sgx
signal
size
sparc64
splice
static_keys
sync
syscall_user_dispatch
sysctl selftests/sysctl: fix wording of help messages 2025-02-27 10:02:12 +01:00
tc-testing selftests/tc-testing: Add test for HFSC queue emptying during peek operation 2025-04-23 17:16:50 -07:00
tdx
thermal/intel
timens
timers selftests/timers: Improve skew_consistency by testing with other clockids 2025-03-21 19:16:18 +01:00
tmpfs
tpm2 selftests: tpm2: test_smoke: use POSIX-conformant expression operator 2025-04-08 14:56:13 -06:00
tty
turbostat
ublk selftests: ublk: common: fix _get_disk_dev_t for pre-9.0 coreutils 2025-04-24 06:30:54 -06:00
uevent
user_events selftests/user_events: Fix failures caused by test code 2025-02-24 16:37:17 -07:00
vDSO Updates for the VDSO infrastructure: 2025-03-25 11:30:42 -07:00
watchdog
wireguard sched/debug: Remove CONFIG_SCHED_DEBUG from self-test config files 2025-03-19 22:23:24 +01:00
x86 selftests: x86: test_mremap_vdso: skip if vdso is msealed 2025-04-01 15:17:15 -07:00
zram
.gitignore selftests: tpm2: create a dedicated .gitignore 2025-04-08 14:56:13 -06:00
Makefile selftest: test system mappings are sealed 2025-04-01 15:17:16 -07:00
gen_kselftest_tar.sh
kselftest.h Revert "selftests: kselftest: Fix build failure with NOLIBC" 2025-02-26 22:13:48 +01:00
kselftest_deps.sh
kselftest_harness.h
kselftest_install.sh
kselftest_module.h
lib.mk selftests: Add headers target 2025-03-03 20:00:12 +01:00
run_kselftest.sh