From: Xu Kuohai <xukuohai@xxxxxxxxxx> This series fix a bug I found when doing rcu waiting cleanup for struct_ops map. When there is sleepable prog in struct_ops map, the map risks being released while the prog is still running. Xu Kuohai (2): bpf: Fix release of struct_ops map selftests/bpf: Add test for struct_ops map release kernel/bpf/bpf_struct_ops.c | 37 +++-- kernel/bpf/syscall.c | 7 +- .../selftests/bpf/bpf_testmod/bpf_testmod.c | 78 ++++++--- .../bpf/bpf_testmod/bpf_testmod_kfunc.h | 2 +- .../bpf/prog_tests/test_struct_ops_module.c | 154 ++++++++++++++++++ .../bpf/progs/struct_ops_map_release.c | 30 ++++ 6 files changed, 267 insertions(+), 41 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/struct_ops_map_release.c -- 2.39.5