aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorDelyan Kratunov2022-03-21 23:29:18 +0000
committerDaniel Borkmann2022-03-30 14:06:59 +0200
commit522574fd7864e091d473765102e866414979b2ab (patch)
tree97879dee0c4610beb021ee2b915a844f6b23fbf9 /kernel
parent77c9387c0c5bd496fba3200024e3618356b2fd34 (diff)
bpftool: Explicit errno handling in skeletons
Andrii noticed that since f97b8b9bd630 ("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: f97b8b9bd630 ("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
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions