linux-stable/tools
Hao Luo a32f5bc59d libbpf: Free btf_vmlinux when closing bpf_object
[ Upstream commit 29d67fdebc ]

I hit a memory leak when testing bpf_program__set_attach_target().
Basically, set_attach_target() may allocate btf_vmlinux, for example,
when setting attach target for bpf_iter programs. But btf_vmlinux
is freed only in bpf_object_load(), which means if we only open
bpf object but not load it, setting attach target may leak
btf_vmlinux.

So let's free btf_vmlinux in bpf_object__close() anyway.

Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230822193840.1509809-1-haoluo@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 11:14:22 +02:00
..
accounting
arch asm-generic: regression fix for 6.5 2023-08-18 18:13:36 +02:00
bootconfig
bpf bpftool: Use a local bpf_perf_event_value to fix accessing its fields 2023-09-13 09:53:02 +02:00
build perf build: Update build rule for generated files 2023-09-19 12:30:26 +02:00
certs
cgroup
counter tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure 2023-07-24 10:29:52 -04:00
debugging
edid
firewire
firmware
gpio
hv vmbus_testing: fix wrong python syntax for integer value comparison 2023-07-23 23:19:30 +00:00
iio
include tools/nolibc: fix up startup failures for -O0 under gcc < 11.1.0 2023-09-13 09:53:01 +02:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Free btf_vmlinux when closing bpf_object 2023-09-23 11:14:22 +02:00
memory-model
mm tools/mm: fix undefined reference to pthread_once 2023-09-19 12:30:13 +02:00
net/ynl tools: ynl-gen: fix parse multi-attr enum attribute 2023-07-26 13:38:23 -07:00
objtool objtool/x86: Fixup frame-pointer vs rethunk 2023-08-17 00:44:35 +02:00
pci
pcmcia
perf perf hists browser: Fix the number of entries for 'e' key 2023-09-19 12:30:26 +02:00
power platform-drivers-x86 for v6.5-1 2023-06-30 14:50:00 -07:00
rcu
scripts
spi
testing selftests/nolibc: prevent out of bounds access in expect_vfprintf 2023-09-23 11:14:19 +02:00
thermal
time
tracing
usb
verification
virtio tools/virtio: fix build break for aarch64 2023-06-27 10:47:08 -04:00
wmi
workqueue
Makefile