VSOCK: Don't dec ack backlog twice for rejected connections
Subsystems (4)
PATCH 1/1 VSOCK: Don't dec ack backlog twice for rejected connections
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 <[email protected]>
Signed-off-by Jorgen Hansen <[email protected]>
Reviewed-by Adit Ranadive <[email protected]>
Reviewed-by Aditya Sarwade <[email protected]>
--- net/vmw_vsock/af_vsock.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
net/vmw_vsock/af_vsock.c +3 -3
@@ -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
@@ -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.
@@ -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" );
Signature · 1 line
1.7.0
From: Jorgen Hansen <[email protected]>
Date: Mon, 26 Sep 2016 23:59:53 -0700
Quoted 11 lines
If a pending socket is marked as rejected, we will decrease the
sk_ack_backlogtwice. So don't decrement it for rejected sockets invsock_pending_work().Testing of the rejected socket path was done through code modifications.
Reported-by Stefan Hajnoczi <[email protected]>Signed-off-by Jorgen Hansen <[email protected]>Reviewed-by Adit Ranadive <[email protected]>Reviewed-by Aditya Sarwade <[email protected]>
Applied, thanks.