linux/tools/testing/selftests
Andrii Nakryiko 197afc6314 libbpf: Don't attempt to load unused subprog as an entry-point BPF program
If BPF code contains unused BPF subprogram and there are no other subprogram
calls (which can realistically happen in real-world applications given
sufficiently smart Clang code optimizations), libbpf will erroneously assume
that subprograms are entry-point programs and will attempt to load them with
UNSPEC program type.

Fix by not relying on subcall instructions and rather detect it based on the
structure of BPF object's sections.

Fixes: 9a94f277c4 ("tools: libbpf: restore the ability to load programs from .text section")
Reported-by: Dmitrii Banshchikov <dbanschikov@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20201107000251.256821-1-andrii@kernel.org
2020-11-09 22:15:23 +01:00
..
android
arm64 kselftest/arm64: Fix check_user_mem test 2020-10-28 13:42:24 +00:00
bpf libbpf: Don't attempt to load unused subprog as an entry-point BPF program 2020-11-09 22:15:23 +01:00
breakpoints
capabilities
cgroup kselftests: cgroup: add perpcu memory accounting test 2020-08-12 10:57:55 -07:00
clone3 selftests/clone3: Avoid OS-defined clone_args 2020-10-08 13:17:25 -07:00
core
cpu-hotplug
cpufreq
dmabuf-heaps
drivers selftests: net: mscc: ocelot: add test for VLAN modify action 2020-10-11 11:19:04 -07:00
efivarfs
exec tools/testing/selftests: add self-test for verifying load alignment 2020-10-16 11:11:21 -07:00
filesystems epoll: add a selftest for epoll timeout race 2020-11-02 12:14:19 -08:00
firmware linux-kselftest-next-5.10-rc1 2020-10-15 15:14:32 -07:00
fpu
ftrace Updates for tracing and bootconfig: 2020-10-15 15:51:28 -07:00
futex
gpio
ia64
intel_pstate
ipc
ir
kcmp
kexec
kmod selftests: kmod: use variable NAME in kmod_test_0001() 2020-08-12 10:58:01 -07:00
kselftest Driver core changes for 5.9-rc1 2020-08-05 11:52:17 -07:00
kvm KVM: selftests: Don't require THP to run tests 2020-10-31 10:35:50 -04:00
lib
livepatch selftests/livepatch: Do not check order when using "comm" for dmesg checking 2020-08-27 15:27:24 +02:00
lkdtm Merge branch 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-22 09:59:21 -07:00
locking
media_tests
membarrier
memfd
memory-hotplug
mincore selftests: add mincore() tests 2020-08-07 11:33:27 -07:00
mount selftests: mount: add nosymfollow tests 2020-08-27 16:06:47 -04:00
mqueue
net selftests: mptcp: depends on built-in IPv6 2020-10-21 20:39:58 -07:00
netfilter networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
nsfs
ntb
openat2
pid_namespace
pidfd threads-v5.10 2020-10-14 14:39:20 -07:00
powerpc powerpc fixes for 5.10 #2 2020-10-24 11:09:13 -07:00
prctl
proc
pstore
ptp
ptrace selftests: Add missing gitignore entries 2020-09-23 10:19:25 -06:00
rcutorture Merge branch 'scftorture.2020.08.24a' into HEAD 2020-09-03 09:47:01 -07:00
resctrl
rseq rseq/selftests: Test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ 2020-09-25 14:23:27 +02:00
rtc
safesetid
seccomp selftests/clone3: Avoid OS-defined clone_args 2020-10-08 13:17:25 -07:00
sigaltstack
size
sparc64
splice selftests: splice: Check behavior of full and short splices 2020-08-07 10:50:11 -07:00
static_keys
sync
sysctl
tc-testing
timens selftests/timens: Add a test for futex() 2020-10-20 17:02:57 +02:00
timers selftests/timers: Turn off timeout setting 2020-08-20 15:49:28 -06:00
tmpfs
tpm2
uevent
user
vDSO
vm selftests/vm: 10x speedup for hmm-tests 2020-10-18 09:27:09 -07:00
watchdog
wireguard wireguard: selftests: check that route_me_harder packets use the right sk 2020-10-30 12:57:38 +01:00
x86 * Misc minor cleanups and corrections to the fsgsbase code and 2020-10-12 10:44:24 -07:00
zram
.gitignore
gen_kselftest_tar.sh
kselftest_deps.sh
kselftest_harness.h selftests: kselftest_harness.h: fix kernel-doc markups 2020-10-28 11:42:02 -06:00
kselftest_install.sh
kselftest_module.h
kselftest.h linux-kselftest-5.9-rc1 2020-08-05 10:28:25 -07:00
lib.mk selftests: Extract run_kselftest.sh and generate stand-alone test list 2020-10-07 07:58:54 -06:00
Makefile selftests: Extract run_kselftest.sh and generate stand-alone test list 2020-10-07 07:58:54 -06:00
run_kselftest.sh selftests/run_kselftest.sh: Make each test individually selectable 2020-10-07 07:59:15 -06:00