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>