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_endian.h
bpf_gen_internal.h
bpf_helpers.h
bpf_prog_linfo.c
bpf_tracing.h
bpf.c
bpf.h
btf_dump.c
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
nlattr.h
relo_core.c
relo_core.h
ringbuf.c
skel_internal.h
str_error.c
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