sst-linux/tools/lib/bpf
Andrii Nakryiko 0144376d20 libbpf: Fix hypothetical STT_SECTION extern NULL deref case
[ Upstream commit e0525cd72b5979d8089fe524a071ea93fd011dc9 ]

Fix theoretical NULL dereference in linker when resolving *extern*
STT_SECTION symbol against not-yet-existing ELF section. Not sure if
it's possible in practice for valid ELF object files (this would require
embedded assembly manipulations, at which point BTF will be missing),
but fix the s/dst_sym/dst_sec/ typo guarding this condition anyways.

Fixes: faf6ed321c ("libbpf: Add BPF static linker APIs")
Fixes: a46349227c ("libbpf: Add linker extern resolution support for functions and global variables")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20250220002821.834400-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-04-10 14:33:33 +02:00
..
.gitignore
bpf_core_read.h bpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD 2024-07-11 12:47:09 +02:00
bpf_endian.h
bpf_gen_internal.h
bpf_helpers.h
bpf_prog_linfo.c
bpf_tracing.h
bpf.c
bpf.h libbpf: Add missing LIBBPF_API annotation to libbpf_set_memlock_rlim API 2024-03-26 18:20:32 -04:00
btf_dump.c libbpf: Fix no-args func prototype BTF dumping syntax 2024-08-03 08:49:48 +02:00
btf.c
btf.h
Build
gen_loader.c
hashmap.c
hashmap.h
libbpf_common.h
libbpf_errno.c
libbpf_internal.h
libbpf_legacy.h
libbpf_probes.c
libbpf_version.h
libbpf.c libbpf: never interpret subprogs in .text as entry programs 2024-12-14 19:53:28 +01:00
libbpf.h
libbpf.map
libbpf.pc.template
linker.c libbpf: Fix hypothetical STT_SECTION extern NULL deref case 2025-04-10 14:33:33 +02:00
Makefile
netlink.c
nlattr.c libbpf: Fix alen calculation in libbpf_nla_dump_errormsg() 2023-03-10 09:33:02 +01:00
nlattr.h libbpf: Switch to void * casting in netlink helpers 2021-06-22 17:04:02 +02:00
relo_core.c
relo_core.h
ringbuf.c
skel_internal.h
str_error.c libbpf: Poison kernel-only integer types 2020-01-10 10:38:00 -08:00
str_error.h
strset.c
strset.h
usdt.bpf.h
usdt.c libbpf: don't adjust USDT semaphore address if .stapsdt.base addr is missing 2025-02-21 13:49:06 +01:00