aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/vsock/vsock_test.c
diff options
context:
space:
mode:
authorMichal Luczaj <mhal@rbox.co>2025-11-23 22:43:59 +0100
committerJakub Kicinski <kuba@kernel.org>2025-11-25 19:16:21 -0800
commitb796632fc83c8f9e0d97443f4f389ef9dddadb11 (patch)
tree147477440564773f2617db5364728716a464b2ce /tools/testing/vsock/vsock_test.c
parentr8169: improve MAC EEE handling (diff)
downloadwireguard-linux-b796632fc83c8f9e0d97443f4f389ef9dddadb11.tar.xz
wireguard-linux-b796632fc83c8f9e0d97443f4f389ef9dddadb11.zip
vsock/test: Extend transport change null-ptr-deref test
syzkaller reported a lockdep lock order inversion warning[1] due to commit 687aa0c5581b ("vsock: Fix transport_* TOCTOU"). This was fixed in commit f7c877e75352 ("vsock: fix lock inversion in vsock_assign_transport()"). Redo syzkaller's repro by piggybacking on a somewhat related test implemented in commit 3a764d93385c ("vsock/test: Add test for null ptr deref when transport changes"). [1]: https://lore.kernel.org/netdev/68f6cdb0.a70a0220.205af.0039.GAE@google.com/ Signed-off-by: Michal Luczaj <mhal@rbox.co> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Link: https://patch.msgid.link/20251123-vsock_test-linger-lockdep-warn-v1-1-4b1edf9d8cdc@rbox.co Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r--tools/testing/vsock/vsock_test.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_test.c
index d4517386e551..9e1250790f33 100644
--- a/tools/testing/vsock/vsock_test.c
+++ b/tools/testing/vsock/vsock_test.c
@@ -2015,6 +2015,11 @@ static void test_stream_transport_change_client(const struct test_opts *opts)
exit(EXIT_FAILURE);
}
+ /* Although setting SO_LINGER does not affect the original test
+ * for null-ptr-deref, it may trigger a lockdep warning.
+ */
+ enable_so_linger(s, 1);
+
ret = connect(s, (struct sockaddr *)&sa, sizeof(sa));
/* The connect can fail due to signals coming from the thread,
* or because the receiver connection queue is full.
@@ -2352,7 +2357,7 @@ static struct test_case test_cases[] = {
.run_server = test_stream_nolinger_server,
},
{
- .name = "SOCK_STREAM transport change null-ptr-deref",
+ .name = "SOCK_STREAM transport change null-ptr-deref, lockdep warn",
.run_client = test_stream_transport_change_client,
.run_server = test_stream_transport_change_server,
},