Context |
Check |
Description |
bpf/vmtest-bpf-next-PR |
fail
|
PR summary
|
netdev/series_format |
success
|
Single patches do not need cover letters
|
netdev/tree_selection |
success
|
Clearly marked for bpf-next
|
netdev/ynl |
success
|
Generated files up to date;
no warnings/errors;
no diff in generated;
|
netdev/fixes_present |
success
|
Fixes tag not required for -next series
|
netdev/header_inline |
success
|
No static functions without inline keyword in header files
|
netdev/build_32bit |
success
|
Errors and warnings before: 932 this patch: 932
|
netdev/build_tools |
success
|
Errors and warnings before: 0 this patch: 0
|
netdev/cc_maintainers |
warning
|
11 maintainers not CCed: song@kernel.org sdf@google.com martin.lau@linux.dev linux-kselftest@vger.kernel.org john.fastabend@gmail.com kpsingh@kernel.org haoluo@google.com mykolal@fb.com shuah@kernel.org eddyz87@gmail.com jolsa@kernel.org
|
netdev/build_clang |
success
|
Errors and warnings before: 937 this patch: 937
|
netdev/verify_signedoff |
success
|
Signed-off-by tag matches author and committer
|
netdev/deprecated_api |
success
|
None detected
|
netdev/check_selftest |
success
|
No net selftest shell script
|
netdev/verify_fixes |
success
|
No Fixes tag
|
netdev/build_allmodconfig_warn |
success
|
Errors and warnings before: 944 this patch: 944
|
netdev/checkpatch |
warning
|
CHECK: Alignment should match open parenthesis
CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Blank lines aren't necessary before a close brace '}'
CHECK: Please don't use multiple blank lines
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
WARNING: braces {} are not necessary for single statement blocks
WARNING: line length of 81 exceeds 80 columns
WARNING: line length of 84 exceeds 80 columns
WARNING: line length of 85 exceeds 80 columns
WARNING: line length of 86 exceeds 80 columns
WARNING: line length of 88 exceeds 80 columns
WARNING: line length of 95 exceeds 80 columns
|
netdev/build_clang_rust |
success
|
No Rust files in patch. Skipping build
|
netdev/kdoc |
success
|
Errors and warnings before: 0 this patch: 0
|
netdev/source_inline |
success
|
Was 0 now: 0
|
bpf/vmtest-bpf-next-VM_Test-0 |
success
|
Logs for Lint
|
bpf/vmtest-bpf-next-VM_Test-1 |
success
|
Logs for ShellCheck
|
bpf/vmtest-bpf-next-VM_Test-2 |
success
|
Logs for Unittests
|
bpf/vmtest-bpf-next-VM_Test-5 |
success
|
Logs for aarch64-gcc / build-release
|
bpf/vmtest-bpf-next-VM_Test-3 |
success
|
Logs for Validate matrix.py
|
bpf/vmtest-bpf-next-VM_Test-4 |
success
|
Logs for aarch64-gcc / build / build for aarch64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-12 |
success
|
Logs for s390x-gcc / build-release
|
bpf/vmtest-bpf-next-VM_Test-10 |
success
|
Logs for aarch64-gcc / veristat
|
bpf/vmtest-bpf-next-VM_Test-11 |
success
|
Logs for s390x-gcc / build / build for s390x with gcc
|
bpf/vmtest-bpf-next-VM_Test-18 |
success
|
Logs for set-matrix
|
bpf/vmtest-bpf-next-VM_Test-19 |
success
|
Logs for x86_64-gcc / build / build for x86_64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-20 |
success
|
Logs for x86_64-gcc / build-release
|
bpf/vmtest-bpf-next-VM_Test-17 |
success
|
Logs for s390x-gcc / veristat
|
bpf/vmtest-bpf-next-VM_Test-36 |
success
|
Logs for x86_64-llvm-18 / build-release / build for x86_64 with llvm-18 and -O2 optimization
|
bpf/vmtest-bpf-next-VM_Test-34 |
success
|
Logs for x86_64-llvm-17 / veristat
|
bpf/vmtest-bpf-next-VM_Test-28 |
success
|
Logs for x86_64-llvm-17 / build / build for x86_64 with llvm-17
|
bpf/vmtest-bpf-next-VM_Test-42 |
success
|
Logs for x86_64-llvm-18 / veristat
|
bpf/vmtest-bpf-next-VM_Test-29 |
success
|
Logs for x86_64-llvm-17 / build-release / build for x86_64 with llvm-17 and -O2 optimization
|
bpf/vmtest-bpf-next-VM_Test-35 |
success
|
Logs for x86_64-llvm-18 / build / build for x86_64 with llvm-18
|
bpf/vmtest-bpf-next-VM_Test-7 |
success
|
Logs for aarch64-gcc / test (test_progs, false, 360) / test_progs on aarch64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-8 |
success
|
Logs for aarch64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on aarch64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-9 |
success
|
Logs for aarch64-gcc / test (test_verifier, false, 360) / test_verifier on aarch64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-6 |
success
|
Logs for aarch64-gcc / test (test_maps, false, 360) / test_maps on aarch64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-16 |
success
|
Logs for s390x-gcc / test (test_verifier, false, 360) / test_verifier on s390x with gcc
|
bpf/vmtest-bpf-next-VM_Test-13 |
success
|
Logs for s390x-gcc / test (test_maps, false, 360) / test_maps on s390x with gcc
|
bpf/vmtest-bpf-next-VM_Test-14 |
fail
|
Logs for s390x-gcc / test (test_progs, false, 360) / test_progs on s390x with gcc
|
bpf/vmtest-bpf-next-VM_Test-15 |
fail
|
Logs for s390x-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on s390x with gcc
|
bpf/vmtest-bpf-next-VM_Test-26 |
success
|
Logs for x86_64-gcc / test (test_verifier, false, 360) / test_verifier on x86_64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-33 |
success
|
Logs for x86_64-llvm-17 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-17
|
bpf/vmtest-bpf-next-VM_Test-30 |
success
|
Logs for x86_64-llvm-17 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-17
|
bpf/vmtest-bpf-next-VM_Test-21 |
success
|
Logs for x86_64-gcc / test (test_maps, false, 360) / test_maps on x86_64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-41 |
success
|
Logs for x86_64-llvm-18 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-18
|
bpf/vmtest-bpf-next-VM_Test-25 |
success
|
Logs for x86_64-gcc / test (test_progs_parallel, true, 30) / test_progs_parallel on x86_64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-23 |
success
|
Logs for x86_64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-22 |
success
|
Logs for x86_64-gcc / test (test_progs, false, 360) / test_progs on x86_64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-31 |
success
|
Logs for x86_64-llvm-17 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-17
|
bpf/vmtest-bpf-next-VM_Test-24 |
success
|
Logs for x86_64-gcc / test (test_progs_no_alu32_parallel, true, 30) / test_progs_no_alu32_parallel on x86_64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-37 |
success
|
Logs for x86_64-llvm-18 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-18
|
bpf/vmtest-bpf-next-VM_Test-38 |
success
|
Logs for x86_64-llvm-18 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-18
|
bpf/vmtest-bpf-next-VM_Test-40 |
success
|
Logs for x86_64-llvm-18 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-18
|
bpf/vmtest-bpf-next-VM_Test-27 |
success
|
Logs for x86_64-gcc / veristat / veristat on x86_64 with gcc
|
bpf/vmtest-bpf-next-VM_Test-39 |
success
|
Logs for x86_64-llvm-18 / test (test_progs_cpuv4, false, 360) / test_progs_cpuv4 on x86_64 with llvm-18
|
bpf/vmtest-bpf-next-VM_Test-32 |
success
|
Logs for x86_64-llvm-17 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-17
|
new file mode 100644
@@ -0,0 +1,69 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <test_progs.h>
+#include <network_helpers.h>
+
+#include "test_queue_stack_nested_map.skel.h"
+
+
+static void test_map_queue_stack_nesting_success(bool is_map_queue)
+{
+ struct test_queue_stack_nested_map *skel;
+ int err;
+
+ skel = test_queue_stack_nested_map__open();
+ if (!ASSERT_OK_PTR(skel, "test_queue_stack_nested_map__open"))
+ return;
+
+ err = test_queue_stack_nested_map__load(skel);
+ if (!ASSERT_OK(err, "test_queue_stack_nested_map__load"))
+ goto out;
+
+ skel->bss->pid = getpid();
+ err = test_queue_stack_nested_map__attach(skel);
+ if (!ASSERT_OK(err, "test_queue_stack_nested_map__attach"))
+ goto out;
+
+ /* trigger map from userspace to check nesting */
+ int value = 0;
+
+ do {
+ if (is_map_queue) {
+ err = bpf_map_update_elem(bpf_map__fd(skel->maps.map_queue),
+ NULL, &value, 0);
+ if (err < 0)
+ break;
+ err = bpf_map_lookup_and_delete_elem(bpf_map__fd(skel->maps.map_queue),
+ NULL, &value);
+ } else {
+ err = bpf_map_update_elem(bpf_map__fd(skel->maps.map_stack),
+ NULL, &value, 0);
+ if (err < 0)
+ break;
+ err = bpf_map_lookup_and_delete_elem(bpf_map__fd(skel->maps.map_stack),
+ NULL, &value);
+ }
+ } while (0);
+
+
+ if (!ASSERT_OK(err, "MAP Write"))
+ goto out;
+
+ if (is_map_queue) {
+ ASSERT_EQ(skel->bss->err_queue_push, -EBUSY, "no map nesting");
+ ASSERT_EQ(skel->bss->err_queue_pop, -EBUSY, "no map nesting");
+ } else {
+ ASSERT_EQ(skel->bss->err_stack, -EBUSY, "no map nesting");
+ }
+out:
+ test_queue_stack_nested_map__destroy(skel);
+}
+
+void test_test_queue_stack_nested_map(void)
+{
+ if (test__start_subtest("map_queue_nesting"))
+ test_map_queue_stack_nesting_success(true);
+ if (test__start_subtest("map_stack_nesting"))
+ test_map_queue_stack_nesting_success(false);
+
+}
+
new file mode 100644
@@ -0,0 +1,116 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "vmlinux.h"
+#include <bpf/bpf_helpers.h>
+#include <bpf/bpf_tracing.h>
+
+struct {
+ __uint(type, BPF_MAP_TYPE_STACK);
+ __uint(max_entries, 32);
+ __uint(key_size, 0);
+ __uint(value_size, sizeof(__u32));
+} map_stack SEC(".maps");
+
+struct {
+ __uint(type, BPF_MAP_TYPE_QUEUE);
+ __uint(max_entries, 32);
+ __uint(key_size, 0);
+ __uint(value_size, sizeof(__u32));
+} map_queue SEC(".maps");
+
+
+int err_queue_push;
+int err_queue_pop;
+int err_stack;
+int pid;
+__u32 trigger_flag_queue_push;
+__u32 trigger_flag_queue_pop;
+__u32 trigger_flag_stack;
+
+SEC("fentry/queue_stack_map_push_elem")
+int BPF_PROG(test_queue_stack_push_trigger, raw_spinlock_t *lock, unsigned long flags)
+{
+
+ if ((bpf_get_current_pid_tgid() >> 32) != pid)
+ return 0;
+
+
+ trigger_flag_queue_push = 1;
+
+ return 0;
+}
+
+SEC("fentry/queue_map_pop_elem")
+int BPF_PROG(test_queue_pop_trigger, raw_spinlock_t *lock, unsigned long flags)
+{
+
+ if ((bpf_get_current_pid_tgid() >> 32) != pid)
+ return 0;
+
+ trigger_flag_queue_pop = 1;
+
+ return 0;
+}
+
+
+SEC("fentry/stack_map_pop_elem")
+int BPF_PROG(test_stack_pop_trigger, raw_spinlock_t *lock, unsigned long flags)
+{
+
+ if ((bpf_get_current_pid_tgid() >> 32) != pid)
+ return 0;
+
+ trigger_flag_stack = 1;
+
+ return 0;
+}
+
+SEC("fentry/_raw_spin_unlock_irqrestore")
+int BPF_PROG(test_queue_pop_nesting, raw_spinlock_t *lock, unsigned long flags)
+{
+ __u32 val;
+
+ if ((bpf_get_current_pid_tgid() >> 32) != pid || trigger_flag_queue_pop != 1)
+ return 0;
+
+
+ err_queue_pop = bpf_map_pop_elem(&map_queue, &val);
+
+ trigger_flag_queue_pop = 0;
+
+ return 0;
+}
+
+SEC("fentry/_raw_spin_unlock_irqrestore")
+int BPF_PROG(test_stack_nesting, raw_spinlock_t *lock, unsigned long flags)
+{
+ __u32 val;
+
+ if ((bpf_get_current_pid_tgid() >> 32) != pid || trigger_flag_stack != 1)
+ return 0;
+
+
+ err_stack = bpf_map_pop_elem(&map_stack, &val);
+
+ trigger_flag_stack = 0;
+
+ return 0;
+}
+
+
+SEC("fentry/_raw_spin_unlock_irqrestore")
+int BPF_PROG(test_queue_push_nesting, raw_spinlock_t *lock, unsigned long flags)
+{
+ __u32 val = 1;
+
+ if ((bpf_get_current_pid_tgid() >> 32) != pid || trigger_flag_queue_push != 1) {
+ return 0;
+ }
+
+ err_queue_push = bpf_map_push_elem(&map_queue, &val, 0);
+
+ trigger_flag_queue_push = 0;
+
+ return 0;
+}
+
+char _license[] SEC("license") = "GPL";
Added selftests to check for nested deadlocks in queue and stack maps. test_map_queue_stack_nesting_success:PASS:test_queue_stack_nested_map__open 0 nsec test_map_queue_stack_nesting_success:PASS:test_queue_stack_nested_map__load 0 nsec test_map_queue_stack_nesting_success:PASS:test_queue_stack_nested_map__attach 0 nsec test_map_queue_stack_nesting_success:PASS:MAP Write 0 nsec test_map_queue_stack_nesting_success:PASS:no map nesting 0 nsec test_map_queue_stack_nesting_success:PASS:no map nesting 0 nsec 384/1 test_queue_stack_nested_map/map_queue_nesting:OK test_map_queue_stack_nesting_success:PASS:test_queue_stack_nested_map__open 0 nsec test_map_queue_stack_nesting_success:PASS:test_queue_stack_nested_map__load 0 nsec test_map_queue_stack_nesting_success:PASS:test_queue_stack_nested_map__attach 0 nsec test_map_queue_stack_nesting_success:PASS:MAP Write 0 nsec test_map_queue_stack_nesting_success:PASS:no map nesting 0 nsec 384/2 test_queue_stack_nested_map/map_stack_nesting:OK 384 test_queue_stack_nested_map:OK Summary: 1/2 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Siddharth Chintamaneni <sidchintamaneni@gmail.com> --- .../prog_tests/test_queue_stack_nested_map.c | 69 +++++++++++ .../bpf/progs/test_queue_stack_nested_map.c | 116 ++++++++++++++++++ 2 files changed, 185 insertions(+) create mode 100644 tools/testing/selftests/bpf/prog_tests/test_queue_stack_nested_map.c create mode 100644 tools/testing/selftests/bpf/progs/test_queue_stack_nested_map.c