linux-stable/tools
Alan Maguire d003ff1f0a libbpf: Add identical pointer detection to btf_dedup_is_equiv()
[ Upstream commit 8e64c387c9 ]

Recently as a side-effect of

commit ac053946f5 ("compiler.h: introduce TYPEOF_UNQUAL() macro")

issues were observed in deduplication between modules and kernel BTF
such that a large number of kernel types were not deduplicated so
were found in module BTF (task_struct, bpf_prog etc).  The root cause
appeared to be a failure to dedup struct types, specifically those
with members that were pointers with __percpu annotations.

The issue in dedup is at the point that we are deduplicating structures,
we have not yet deduplicated reference types like pointers.  If multiple
copies of a pointer point at the same (deduplicated) integer as in this
case, we do not see them as identical.  Special handling already exists
to deal with structures and arrays, so add pointer handling here too.

Reported-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250429161042.2069678-1-alan.maguire@oracle.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-27 11:11:32 +01:00
..
accounting
arch x86/insn: Fix opcode map (!REX2) superscript tags 2025-06-19 15:31:28 +02:00
bootconfig
bpf tools/resolve_btfids: Fix build when cross compiling kernel with clang. 2025-06-19 15:32:33 +02:00
build tools/build: Don't pass test log files to linker 2025-05-29 11:02:08 +02:00
certs
cgroup
counter
crypto
debugging
firewire
firmware
gpio
hv
iio
include bpf: Allow pre-ordering for bpf cgroup progs 2025-05-29 11:02:17 +02:00
kvm/kvm_stat
laptop
leds
lib libbpf: Add identical pointer detection to btf_dedup_is_equiv() 2025-06-27 11:11:32 +01:00
memory-model
mm
net tools: ynl-gen: validate 0 len strings from kernel 2025-05-29 11:03:12 +02:00
objtool objtool/rust: relax slice condition to cover more noreturn Rust functions 2025-06-19 15:32:33 +02:00
pci
pcmcia
perf perf callchain: Always populate the addr_location map when adding IP 2025-06-19 15:32:08 +02:00
power tools/power turbostat: Fix AMD package-energy reporting 2025-06-19 15:32:21 +02:00
rcu
sched_ext
scripts
sound
spi
testing selftests: net: build net/lib dependency in all target 2025-06-19 15:32:18 +02:00
thermal
time
tracing
usb
verification
virtio
wmi
workqueue
writeback
Makefile