linux-stable/tools
Delyan Kratunov 522574fd78 bpftool: Explicit errno handling in skeletons
Andrii noticed that since f97b8b9bd6 ("bpftool: Fix a bug in subskeleton
code generation") the subskeleton code allows bpf_object__destroy_subskeleton
to overwrite the errno that subskeleton__open would return with. While this
is not currently an issue, let's make it future-proof.

This patch explicitly tracks err in subskeleton__open and skeleton__create
(i.e. calloc failure is explicitly ENOMEM) and ensures that errno is -err on
the error return path. The skeleton code had to be changed since maps and
progs codegen is shared with subskeletons.

Fixes: f97b8b9bd6 ("bpftool: Fix a bug in subskeleton code generation")
Signed-off-by: Delyan Kratunov <delyank@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/3b6bfbb770c79ae64d8de26c1c1bd9d53a4b85f8.camel@fb.com
2022-03-30 14:06:59 +02:00
..
accounting delayacct: track delays from memory compact 2022-01-20 08:52:55 +02:00
arch perf tools changes for v5.18: 1st batch 2022-03-27 13:42:32 -07:00
bootconfig
bpf bpftool: Explicit errno handling in skeletons 2022-03-30 14:06:59 +02:00
build
cgroup tools/cgroup/slabinfo: update to work with struct slab 2022-02-21 11:34:49 +01:00
counter
debugging
edid
firewire
firmware
gpio
hv
iio iio: introduce mag_referenced 2022-02-21 19:33:05 +00:00
include bpf: Sync comments for bpf_get_stack 2022-03-28 19:06:35 -07:00
io_uring
kvm/kvm_stat
laptop
leds
lib perf tools changes for v5.18: 1st batch 2022-03-27 13:42:32 -07:00
memory-model tools/memory-model: Explain syntactic and semantic dependencies 2022-02-01 17:32:30 -08:00
objtool objtool: Find unused ENDBR instructions 2022-03-15 10:32:47 +01:00
pci
pcmcia
perf perf tools changes for v5.18: 1st batch 2022-03-27 13:42:32 -07:00
power Thermal control updates for 5.18-rc1 2022-03-21 14:35:11 -07:00
rcu
scripts tools: Fix unavoidable GCC call in Clang builds 2022-03-08 23:36:37 +01:00
spi
testing selftests/bpf: Fix clang compilation errors 2022-03-28 20:00:11 -07:00
thermal/tmon
time
tracing rtla: Tools main loop cleanup 2022-03-15 14:36:50 -04:00
usb
virtio tools/virtio: handle fallout from folio work 2022-03-06 06:06:50 -05:00
vm tools/vm/page_owner_sort.c: support for user-defined culling rules 2022-03-24 19:06:45 -07:00
wmi
Makefile