linux/tools
Varun R Mallya 5714ca8cba libbpf: Fix OOB read in btf_dump_get_bitfield_value
When dumping bitfield data, btf_dump_get_bitfield_value() reads data
based on the underlying type's size (t->size). However, it does not
verify that the provided data buffer (data_sz) is large enough to
contain these bytes.

If btf_dump__dump_type_data() is called with a buffer smaller than
the type's size, this leads to an out-of-bounds read. This was
confirmed by AddressSanitizer in the linked issue.

Fix this by ensuring we do not read past the provided data_sz limit.

Fixes: a1d3cc3c5e ("libbpf: Avoid use of __int128 in typed dump display")
Reported-by: Harrison Green <harrisonmichaelgreen@gmail.com>
Suggested-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Varun R Mallya <varunrmallya@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260106233527.163487-1-varunrmallya@gmail.com

Closes: https://github.com/libbpf/libbpf/issues/928
2026-01-09 15:54:31 -08:00
..
accounting
arch [GIT PULL] perf tools changes for v6.19 2025-12-07 07:07:02 -08:00
bootconfig
bpf bpftool: Make skeleton C++ compatible with explicit casts 2026-01-09 11:01:54 -08:00
build [GIT PULL] perf tools changes for v6.19 2025-12-07 07:07:02 -08:00
certs
cgroup
counter
crypto
debugging
dma dma-mapping updates for Linux 6.19: 2025-12-06 09:25:05 -08:00
docs docs: makefile: move rustdoc check to the build wrapper 2025-11-29 08:42:53 -07:00
firewire
firmware
gpio
hv
iio
include bpf: Introduce BPF_F_CPU and BPF_F_ALL_CPUS flags 2026-01-06 20:48:32 -08:00
kvm/kvm_stat
laptop
leds
lib libbpf: Fix OOB read in btf_dump_get_bitfield_value 2026-01-09 15:54:31 -08:00
memory-model
mm
net NFSD 6.19 Release Notes 2025-12-06 10:57:02 -08:00
objtool objtool: Add more robust signal error handling, detect and warn about stack overflows 2025-12-03 19:42:37 +01:00
pcmcia
perf [GIT PULL] perf tools changes for v6.19 2025-12-07 07:07:02 -08:00
power platform-drivers-x86 for v6.19-1 2025-12-10 06:38:17 +09:00
rcu
sched
sched_ext lib/Kconfig.debug: Set the minimum required pahole version to v1.22 2025-12-19 10:55:40 -08:00
scripts
sound
spi
testing bpf: GCC requires function attributes before the declarator 2026-01-06 21:04:11 -08:00
thermal
time
tracing rtla updaets for v6.19: 2025-12-05 09:34:01 -08:00
usb
verification
virtio tools/virtio: replace "__auto_type" with "auto" 2025-12-08 15:32:15 -08:00
wmi
workqueue
writeback
Makefile