diff options
author | Delyan Kratunov | 2022-03-21 23:29:18 +0000 |
---|---|---|
committer | Daniel Borkmann | 2022-03-30 14:06:59 +0200 |
commit | 522574fd7864e091d473765102e866414979b2ab (patch) | |
tree | 97879dee0c4610beb021ee2b915a844f6b23fbf9 /kernel | |
parent | 77c9387c0c5bd496fba3200024e3618356b2fd34 (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