diff options
author | Roberto Sassu <roberto.sassu@huawei.com> | 2022-10-06 13:07:36 +0200 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-10-11 01:49:43 +0200 |
commit | a9c7c18b57594c72a63fad749021b743c65a098b (patch) | |
tree | ac20de3e8053e3d82b65622bfe106d4243101fe4 /tools/testing/selftests/bpf/DENYLIST.s390x | |
parent | libbpf: Introduce bpf_link_get_fd_by_id_opts() (diff) | |
download | linux-a9c7c18b57594c72a63fad749021b743c65a098b.tar.xz linux-a9c7c18b57594c72a63fad749021b743c65a098b.zip |
selftests/bpf: Add tests for _opts variants of bpf_*_get_fd_by_id()
Introduce the data_input map, write-protected with a small eBPF program
implementing the lsm/bpf_map hook.
Then, ensure that bpf_map_get_fd_by_id() and bpf_map_get_fd_by_id_opts()
with NULL opts don't succeed due to requesting read-write access to the
write-protected map. Also, ensure that bpf_map_get_fd_by_id_opts() with
open_flags in opts set to BPF_F_RDONLY instead succeeds.
After obtaining a read-only fd, ensure that only map lookup succeeds and
not update. Ensure that update works only with the read-write fd obtained
at program loading time, when the write protection was not yet enabled.
Finally, ensure that the other _opts variants of bpf_*_get_fd_by_id() don't
work if the BPF_F_RDONLY flag is set in opts (due to the kernel not
handling the open_flags member of bpf_attr).
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20221006110736.84253-7-roberto.sassu@huaweicloud.com
Diffstat (limited to 'tools/testing/selftests/bpf/DENYLIST.s390x')
-rw-r--r-- | tools/testing/selftests/bpf/DENYLIST.s390x | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/DENYLIST.s390x b/tools/testing/selftests/bpf/DENYLIST.s390x index 0fb03b8047d5..beef1232a47a 100644 --- a/tools/testing/selftests/bpf/DENYLIST.s390x +++ b/tools/testing/selftests/bpf/DENYLIST.s390x @@ -76,3 +76,4 @@ lookup_key # JIT does not support calling kernel f verify_pkcs7_sig # JIT does not support calling kernel function (kfunc) kfunc_dynptr_param # JIT does not support calling kernel function (kfunc) deny_namespace # failed to attach: ERROR: strerror_r(-524)=22 (trampoline) +libbpf_get_fd_by_id_opts # failed to attach: ERROR: strerror_r(-524)=22 (trampoline) |