Message ID | 20221207172434.435893-8-roberto.sassu@huaweicloud.com (mailing list archive) |
---|---|
State | RFC |
Delegated to: | BPF |
Headers | show |
Series | bpf-lsm: Check return values of security modules | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Guessing tree name failed - patch did not apply, async |
bpf/vmtest-bpf-PR | success | PR summary |
bpf/vmtest-bpf-VM_Test-1 | success | Logs for ${{ matrix.test }} on ${{ matrix.arch }} with ${{ matrix.toolchain }} |
bpf/vmtest-bpf-VM_Test-2 | success | Logs for ShellCheck |
bpf/vmtest-bpf-VM_Test-3 | success | Logs for build for aarch64 with gcc |
bpf/vmtest-bpf-VM_Test-4 | success | Logs for build for aarch64 with llvm-16 |
bpf/vmtest-bpf-VM_Test-5 | fail | Logs for build for s390x with gcc |
bpf/vmtest-bpf-VM_Test-6 | success | Logs for build for x86_64 with gcc |
bpf/vmtest-bpf-VM_Test-7 | success | Logs for build for x86_64 with llvm-16 |
bpf/vmtest-bpf-VM_Test-8 | success | Logs for llvm-toolchain |
bpf/vmtest-bpf-VM_Test-9 | success | Logs for set-matrix |
diff --git a/tools/testing/selftests/bpf/progs/test_libbpf_get_fd_by_id_opts.c b/tools/testing/selftests/bpf/progs/test_libbpf_get_fd_by_id_opts.c index f5ac5f3e8919..a143dbbd5573 100644 --- a/tools/testing/selftests/bpf/progs/test_libbpf_get_fd_by_id_opts.c +++ b/tools/testing/selftests/bpf/progs/test_libbpf_get_fd_by_id_opts.c @@ -29,8 +29,13 @@ int BPF_PROG(check_access, struct bpf_map *map, fmode_t fmode) if (map != (struct bpf_map *)&data_input) return 0; + /* + * Prefer -EPERM to -EACCES to avoid ANDing negative numbers in the + * no_alu32 version, which results in the current register bounds to + * be lost. + */ if (fmode & FMODE_WRITE) - return -EACCES; + return -EPERM; return 0; }