netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: "Jorgen S. Hansen" <jhansen@vmware.com>
Cc: Aditya Sarwade <asarwade@vmware.com>,
	Thomas Hellstrom <thellstrom@vmware.com>,
	Petr Masik <Petr.Masik@nudz.cz>,
	Ben Hutchings <ben@decadent.org.uk>,
	Sasha Levin <alexander.levin@verizon.com>,
	netdev@vger.kernel.org, Stable tree <stable@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH stable-3.16 3/3] VSOCK: Detach QP check should filter out non matching QPs.
Date: Wed, 13 Sep 2017 17:23:07 +0200	[thread overview]
Message-ID: <20170913152307.20317-3-mhocko@kernel.org> (raw)
In-Reply-To: <20170913152307.20317-1-mhocko@kernel.org>

From: Jorgen Hansen <jhansen@vmware.com>

commit 8ab18d71de8b07d2c4d6f984b718418c09ea45c5 upstream.

The check in vmci_transport_peer_detach_cb should only allow a
detach when the qp handle of the transport matches the one in
the detach message.

Testing: Before this change, a detach from a peer on a different
socket would cause an active stream socket to register a detach.

Reviewed-by: George Zhang <georgezhang@vmware.com>
Signed-off-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Michal Hocko <mhocko@suse.com>
---
 net/vmw_vsock/vmci_transport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
index 314312272e08..c69c990ec4a2 100644
--- a/net/vmw_vsock/vmci_transport.c
+++ b/net/vmw_vsock/vmci_transport.c
@@ -844,7 +844,7 @@ static void vmci_transport_peer_detach_cb(u32 sub_id,
 	 * qp_handle.
 	 */
 	if (vmci_handle_is_invalid(e_payload->handle) ||
-	    vmci_handle_is_equal(trans->qp_handle, e_payload->handle))
+	    !vmci_handle_is_equal(trans->qp_handle, e_payload->handle))
 		return;
 
 	/* We don't ask for delayed CBs when we subscribe to this event (we
@@ -2158,7 +2158,7 @@ module_exit(vmci_transport_exit);
 
 MODULE_AUTHOR("VMware, Inc.");
 MODULE_DESCRIPTION("VMCI transport for Virtual Sockets");
-MODULE_VERSION("1.0.2.0-k");
+MODULE_VERSION("1.0.3.0-k");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("vmware_vsock");
 MODULE_ALIAS_NETPROTO(PF_VSOCK);
-- 
2.14.1

  parent reply	other threads:[~2017-09-13 15:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12  9:08 scheduling while atomic from vmci_transport_recv_stream_cb in 3.16 kernels Michal Hocko
2017-09-13 15:07 ` Jorgen S. Hansen
2017-09-13 15:19   ` Michal Hocko
2017-09-13 15:23     ` [PATCH stable-3.16 1/3] VSOCK: sock_put wasn't safe to call in interrupt context Michal Hocko
2017-09-13 15:23       ` [PATCH stable-3.16 2/3] VSOCK: Fix lockdep issue Michal Hocko
2017-09-13 15:23       ` Michal Hocko [this message]
2017-09-13 18:58     ` scheduling while atomic from vmci_transport_recv_stream_cb in 3.16 kernels Jorgen S. Hansen
2017-09-14  8:59       ` Michal Hocko
2017-09-15 17:12         ` Ben Hutchings
2017-09-18  6:11           ` Michal Hocko
2017-11-21 19:58     ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170913152307.20317-3-mhocko@kernel.org \
    --to=mhocko@kernel.org \
    --cc=Petr.Masik@nudz.cz \
    --cc=alexander.levin@verizon.com \
    --cc=asarwade@vmware.com \
    --cc=ben@decadent.org.uk \
    --cc=jhansen@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thellstrom@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).