]> git.ipfire.org Git - thirdparty/man-pages.git/commit
bpf.2: Added missing EAGAIN error case for BPF_PROG_LOAD
authorMichael Weiß <michael.weiss@aisec.fraunhofer.de>
Fri, 21 Jul 2023 12:06:36 +0000 (14:06 +0200)
committerAlejandro Colomar <alx@kernel.org>
Fri, 28 Jul 2023 19:42:16 +0000 (21:42 +0200)
commitec32926e9b5aa37c4c40fc8c09497cf2a50560a7
tree0b2c41e90fc6b511139df34d1764d31679488ee9
parente0a36923ddcf1349b8c557ccf6c80fb59b831eff
bpf.2: Added missing EAGAIN error case for BPF_PROG_LOAD

Since commit c3494801cd1785e2 ("bpf: check pending signals while
verifying programs"), bpf() may also fail with EAGAIN if the verifier
detects pending signals.

This was triggered in the cmld of GyroidOS when loading a cgroups device
program during container start.  We had a look in the man page and were
confused that EAGAIN was not listed as possible error.  Digging in the
kernel source revealed the EAGAIN in the verifier introduced by the
commit above.  Further investigation showed that libbpf already wraps
that case, by a retry loop.

Since GyroidOS uses the system call directly and not libbpf, we missed
to handle this error correctly.  Thus, this hint in the man page for the
bpf() system call should be helpful for others who implement on the
low-level interface, too.

Signed-off-by: Michael Weiß <michael.weiss@aisec.fraunhofer.de>
Cc: Alexei Starovoitov <ast@kernel.org>
[alx: wfix]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man2/bpf.2