Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vsock/virtio: fix accept queue count leak on transport mismatch

virtio_transport_recv_listen() calls sk_acceptq_added() before
vsock_assign_transport(). If vsock_assign_transport() fails or
selects a different transport, the error path returns without
calling sk_acceptq_removed(), permanently incrementing
sk_ack_backlog.

After approximately backlog+1 such failures, sk_acceptq_is_full()
returns true, causing the listener to reject all new connections.

Fix by moving sk_acceptq_added() to after the transport validation,
matching the pattern used by vmci_transport and hyperv_transport.

Fixes: c0cfa2d8a788 ("vsock: add multi-transports support")
Signed-off-by: Dudu Lu <phx0fer@gmail.com>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
Reviewed-by: Luigi Leonardi <leonardi@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/20260413131409.19022-1-phx0fer@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Dudu Lu and committed by
Paolo Abeni
52bcb57a 104f082f

+1 -2
+1 -2
net/vmw_vsock/virtio_transport_common.c
··· 1558 1558 return -ENOMEM; 1559 1559 } 1560 1560 1561 - sk_acceptq_added(sk); 1562 - 1563 1561 lock_sock_nested(child, SINGLE_DEPTH_NESTING); 1564 1562 1565 1563 child->sk_state = TCP_ESTABLISHED; ··· 1579 1581 return ret; 1580 1582 } 1581 1583 1584 + sk_acceptq_added(sk); 1582 1585 if (virtio_transport_space_update(child, skb)) 1583 1586 child->sk_write_space(child); 1584 1587