bpf: Set and check spin lock value in sk_storage_map_test
authorXu Kuohai <xukuohai@huawei.com>
Mon, 14 Nov 2022 13:47:20 +0000 (08:47 -0500)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 21 Nov 2022 19:45:38 +0000 (11:45 -0800)
commitd59d3b8a3ed1d9006c602d991d52b351ed851180
treeac8d7fad28e76be189e3ced62730fffda253b2e5
parent836e49e103dfeeff670c934b7d563cbd982fce87
bpf: Set and check spin lock value in sk_storage_map_test

Update sk_storage_map_test to make sure kernel does not copy user
non-zero value spin lock to kernel, and does not copy kernel spin
lock value to user.

If user spin lock value is copied to kernel, this test case will
make kernel spin on the copied lock, resulting in rcu stall and
softlockup.

Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Link: https://lore.kernel.org/r/20221114134720.1057939-3-xukuohai@huawei.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/map_tests/sk_storage_map.c