diff options
author | Jorgen Hansen <jhansen@vmware.com> | 2016-09-27 02:59:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-27 07:59:25 -0400 |
commit | 1190cfdb1a19d89561ae51cff7d9c2ead24b3ebe (patch) | |
tree | c7c3e0042bd4ab2e75eb98a275788bd59cf1ac57 | |
parent | bf1a85a8381a0f749aa321d7881b456b36eb398d (diff) |
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 <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>
-rw-r--r-- | net/vmw_vsock/af_vsock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 17dbbe64cd73..8a398b3fb532 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c | |||
@@ -465,6 +465,8 @@ void vsock_pending_work(struct work_struct *work) | |||
465 | 465 | ||
466 | if (vsock_is_pending(sk)) { | 466 | if (vsock_is_pending(sk)) { |
467 | vsock_remove_pending(listener, sk); | 467 | vsock_remove_pending(listener, sk); |
468 | |||
469 | listener->sk_ack_backlog--; | ||
468 | } else if (!vsk->rejected) { | 470 | } else if (!vsk->rejected) { |
469 | /* We are not on the pending list and accept() did not reject | 471 | /* We are not on the pending list and accept() did not reject |
470 | * us, so we must have been accepted by our user process. We | 472 | * us, so we must have been accepted by our user process. We |
@@ -475,8 +477,6 @@ void vsock_pending_work(struct work_struct *work) | |||
475 | goto out; | 477 | goto out; |
476 | } | 478 | } |
477 | 479 | ||
478 | listener->sk_ack_backlog--; | ||
479 | |||
480 | /* We need to remove ourself from the global connected sockets list so | 480 | /* We need to remove ourself from the global connected sockets list so |
481 | * incoming packets can't find this socket, and to reduce the reference | 481 | * incoming packets can't find this socket, and to reduce the reference |
482 | * count. | 482 | * count. |
@@ -2010,5 +2010,5 @@ EXPORT_SYMBOL_GPL(vsock_core_get_transport); | |||
2010 | 2010 | ||
2011 | MODULE_AUTHOR("VMware, Inc."); | 2011 | MODULE_AUTHOR("VMware, Inc."); |
2012 | MODULE_DESCRIPTION("VMware Virtual Socket Family"); | 2012 | MODULE_DESCRIPTION("VMware Virtual Socket Family"); |
2013 | MODULE_VERSION("1.0.1.0-k"); | 2013 | MODULE_VERSION("1.0.2.0-k"); |
2014 | MODULE_LICENSE("GPL v2"); | 2014 | MODULE_LICENSE("GPL v2"); |