E2BIG
The eBPF program is too large or a map reached the
max_entries limit (maximum number of elements).
EACCES
For BPF_PROG_LOAD
, even though all program instructions
are valid, the program has been rejected because it was
deemed unsafe. This may be because it may have accessed a
disallowed memory region or an uninitialized
stack/register or because the function constraints don't
match the actual types or because there was a misaligned
memory access. In this case, it is recommended to call
bpf
() again with log_level = 1 and examine log_buf for the
specific reason provided by the verifier.
EBADF
fd is not an open file descriptor.
EFAULT
One of the pointers (key or value or log_buf or insns) is
outside the accessible address space.
EINVAL
The value specified in cmd is not recognized by this
kernel.
EINVAL
For BPF_MAP_CREATE
, either map_type or attributes are
invalid.
EINVAL
For BPF_MAP_*_ELEM
commands, some of the fields of union
bpf_attr that are not used by this command are not set to
zero.
EINVAL
For BPF_PROG_LOAD
, indicates an attempt to load an invalid
program. eBPF programs can be deemed invalid due to
unrecognized instructions, the use of reserved fields,
jumps out of range, infinite loops or calls of unknown
functions.
ENOENT
For BPF_MAP_LOOKUP_ELEM
or BPF_MAP_DELETE_ELEM
, indicates
that the element with the given key was not found.
ENOMEM
Cannot allocate sufficient memory.
EPERM
The call was made without sufficient privilege (without
the CAP_SYS_ADMIN
capability).