selftests/bpf: Add test case for element reuse in htab map
authorHou Tao <houtao1@huawei.com>
Wed, 15 Feb 2023 08:21:32 +0000 (16:21 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 15 Feb 2023 23:40:06 +0000 (15:40 -0800)
commitf88da2d46cc9a19b0c233285339659cae36c5d9a
treec36bec94b00c337da6266687758715ec9eaa0f92
parent997849c4b969034e225153f41026657def66d286
selftests/bpf: Add test case for element reuse in htab map

The reinitialization of spin-lock in map value after immediate reuse may
corrupt lookup with BPF_F_LOCK flag and result in hard lock-up, so add
one test case to demonstrate the problem.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20230215082132.3856544-3-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/htab_reuse.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/htab_reuse.c [new file with mode: 0644]