netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] Fix release of struct_ops map
@ 2024-11-08  8:26 Xu Kuohai
  2024-11-08  8:26 ` [PATCH bpf-next 1/2] bpf: " Xu Kuohai
  2024-11-08  8:26 ` [PATCH bpf-next 2/2] selftests/bpf: Add test for struct_ops map release Xu Kuohai
  0 siblings, 2 replies; 8+ messages in thread
From: Xu Kuohai @ 2024-11-08  8:26 UTC (permalink / raw)
  To: bpf, netdev
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Yonghong Song, Kui-Feng Lee

From: Xu Kuohai <xukuohai@huawei.com>

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-11-12 12:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08  8:26 [PATCH bpf-next 0/2] Fix release of struct_ops map Xu Kuohai
2024-11-08  8:26 ` [PATCH bpf-next 1/2] bpf: " Xu Kuohai
2024-11-08 17:00   ` Alexei Starovoitov
2024-11-08  8:26 ` [PATCH bpf-next 2/2] selftests/bpf: Add test for struct_ops map release Xu Kuohai
2024-11-08 19:39   ` Martin KaFai Lau
2024-11-09  8:40     ` Xu Kuohai
2024-11-11 21:30       ` Martin KaFai Lau
2024-11-12 12:22         ` Xu Kuohai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).