selftests/bpf: add test for softlock when modifying hashmap while iterating
authorBrandon Kammerdiener <brandon.kammerdiener@intel.com>
Thu, 24 Apr 2025 15:32:55 +0000 (11:32 -0400)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 25 Apr 2025 15:36:59 +0000 (08:36 -0700)
commit3d9c463f959f41cd6616ebf8a5d15e9d3ef04f16
tree4c40aabec804482096aa1993ebb93a92ebc74d64
parent75673fda0c557ae26078177dd14d4857afbf128d
selftests/bpf: add test for softlock when modifying hashmap while iterating

Add test that modifies the map while it's being iterated in such a way that
hangs the kernel thread unless the _safe fix is applied to
bpf_for_each_hash_elem.

Signed-off-by: Brandon Kammerdiener <brandon.kammerdiener@intel.com>
Link: https://lore.kernel.org/r/20250424153246.141677-3-brandon.kammerdiener@intel.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Hou Tao <houtao1@huawei.com>
tools/testing/selftests/bpf/prog_tests/for_each.c
tools/testing/selftests/bpf/progs/for_each_hash_modify.c [new file with mode: 0644]