Skip to content

Commit

Permalink
VSOCK: Don't dec ack backlog twice for rejected connections
Browse files Browse the repository at this point in the history
If a pending socket is marked as rejected, we will decrease the
sk_ack_backlog twice. So don't decrement it for rejected sockets
in vsock_pending_work().

Testing of the rejected socket path was done through code
modifications.

Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Jorgen Hansen <jhansen@vmware.com>
Reviewed-by: Adit Ranadive <aditr@vmware.com>
Reviewed-by: Aditya Sarwade <asarwade@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jorgen Hansen authored and David S. Miller committed Sep 27, 2016
1 parent bf1a85a commit 1190cfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/vmw_vsock/af_vsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ void vsock_pending_work(struct work_struct *work)

if (vsock_is_pending(sk)) {
vsock_remove_pending(listener, sk);

listener->sk_ack_backlog--;
} else if (!vsk->rejected) {
/* We are not on the pending list and accept() did not reject
* us, so we must have been accepted by our user process. We
Expand All @@ -475,8 +477,6 @@ void vsock_pending_work(struct work_struct *work)
goto out;
}

listener->sk_ack_backlog--;

/* We need to remove ourself from the global connected sockets list so
* incoming packets can't find this socket, and to reduce the reference
* count.
Expand Down Expand Up @@ -2010,5 +2010,5 @@ EXPORT_SYMBOL_GPL(vsock_core_get_transport);

MODULE_AUTHOR("VMware, Inc.");
MODULE_DESCRIPTION("VMware Virtual Socket Family");
MODULE_VERSION("1.0.1.0-k");
MODULE_VERSION("1.0.2.0-k");
MODULE_LICENSE("GPL v2");

0 comments on commit 1190cfd

Please sign in to comment.