![]() + /* update bpf map concurrently on CPU0 in NMI and Task context.ĭiff -git a/tools/testing/selftests/bpf/progs/htab_deadlock.c b/tools/testing/selftests/bpf/progs/htab_deadlock.c + pthread_setaffinity_np(pthread_self(), sizeof(cpus), &cpus) + if (!ASSERT_OK_PTR(link, "attach_perf_event")) + if (!ASSERT_OK_PTR(skel, "skel_open_and_load")) + pfd = syscall(_NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC) Kfunc_call # 'bpf_prog_active': not found in kernel BTF (?)ĭiff -git a/tools/testing/selftests/bpf/prog_tests/htab_deadlock.c b/tools/testing/selftests/bpf/prog_tests/htab_deadlock.c Jit_probe_mem # jit_probe_mem_open_and_load unexpected error: -524 (kfunc) Htab_update # failed to attach: ERROR: strerror_r(-524)=22 (trampoline) Get_stack_raw_tp # user_stack corrupted user stack (no backchain userspace) ![]() Get_func_ip_test # get_func_ip_test_attach unexpected error: -524 (trampoline) a/tools/testing/selftests/bpf/DENYLIST.s390x Kfunc_call/subprog_lskel # skel unexpected error: -2ĭiff -git a/tools/testing/selftests/bpf/DENYLIST.s390x b/tools/testing/selftests/bpf/DENYLIST.s390x Kfunc_call/subprog # extern (var ksym) 'bpf_prog_active': not found in kernel BTF Kfree_skb # attach fentry unexpected error: -524 (trampoline) +htab_deadlock # fentry failed: -524 (trampoline) Get_func_ip_test # get_func_ip_test_attach unexpected error: -524 (errno 524) (trampoline) Get_func_args_test # get_func_args_test_attach unexpected error: -524 (errno 524) (trampoline) +++ -24,6 +24,7 fexit_test # fexit_attach unexpected error a/tools/testing/selftests/bpf/DENYLIST.aarch64 selftests/bpf/progs/htab_deadlock.c | 30 ++++++++Ĭreate mode 100644 tools/testing/selftests/bpf/prog_tests/htab_deadlock.cĬreate mode 100644 tools/testing/selftests/bpf/progs/htab_deadlock.cĭiff -git a/tools/testing/selftests/bpf/DENYLIST.aarch64 b/tools/testing/selftests/bpf/DENYLIST.aarch64 Tools/testing/selftests/bpf/DENYLIST.s390x | 1 + Tools/testing/selftests/bpf/DENYLIST.aarch64 | 1 + Then fentry nmi_handle and update hash map will reproduce the issue. Map syscall increase this counter in bpf_disable_instrumentation. Note that bpf_overflow_handler checks bpf_prog_active, but in bpf update The selftest use perf to produce the NMI and fentry nmi_handle. * so same bucket index but map_locked index is different. * NMI using key 4 and Task context using key 20. NMI, if the same map bucket was locked, there will be a deadlock. ![]() We update htab map in Task and NMI context. This testing show how to reproduce deadlock in special case. 9:29 bpf: hash map, avoid deadlock with suitable hash mask 9:29 ` tongġ sibling, 0 replies 10+ messages in thread
0 Comments
Leave a Reply. |