Jakub Sitnicki wrote: > Commit 7e81a3530206 ("bpf: Sockmap, ensure sock lock held during tear > down") introduced sleeping issues inside RCU critical sections and while > holding a spinlock on sockmap/sockhash tear-down. There has to be at least > one socket in the map for the problem to surface. > > This adds a test that triggers the warnings for broken locking rules. Not a > fix per se, but rather tooling to verify the accompanying fixes. Run on a > VM with 1 vCPU to reproduce the warnings. > > Fixes: 7e81a3530206 ("bpf: Sockmap, ensure sock lock held during tear down") > Signed-off-by: Jakub Sitnicki <jakub@xxxxxxxxxxxxxx> > --- > .../selftests/bpf/prog_tests/sockmap_basic.c | 74 +++++++++++++++++++ > 1 file changed, 74 insertions(+) > create mode 100644 tools/testing/selftests/bpf/prog_tests/sockmap_basic.c > > diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c > new file mode 100644 > index 000000000000..07f5b462c2ef > --- /dev/null > +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c Yes! This helps a lot now we will get some coverege on these cases. Acked-by: John Fastabend <john.fastabend@xxxxxxxxx>