From: "Jorgen S. Hansen" <jhansen@vmware.com>
To: Dexuan Cui <decui@microsoft.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
KY Srinivasan <kys@microsoft.com>,
"Haiyang Zhang" <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
George Zhang <georgezhang@vmware.com>,
Michal Kubecek <mkubecek@suse.cz>, Asias He <asias@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
"Vitaly Kuznetsov" <vkuznets@redhat.com>,
Cathy Avery <cavery@redhat.com>,
"jasowang@redhat.com" <jasowang@redhat.com>,
Rolf Neugebauer <rolf.neugebauer@docker.com>,
Dave Scott <dave.scott@docker.com>,
"Marcelo Cerri" <marcelo.cerri@canonical.com>,
"apw@canonical.com" <apw@canonical.com>,
"olaf@aepfle.de" <olaf@aepfle.de>,
"joe@perches.com" <joe@perches.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH net-next 2/3] vsock: fix vsock_dequeue/enqueue_accept race
Date: Thu, 17 Aug 2017 12:43:23 +0000 [thread overview]
Message-ID: <E062F976-DF33-46CB-AB17-07F014AE138A@vmware.com> (raw)
In-Reply-To: <KL1P15301MB00082249964D8EF1BAA48790BF8D0@KL1P15301MB0008.APCP153.PROD.OUTLOOK.COM>
> On Aug 16, 2017, at 12:15 AM, Dexuan Cui <decui@microsoft.com> wrote:
>
>
> With the current code, when vsock_dequeue_accept() is removing a sock
> from the list, nothing prevents vsock_enqueue_accept() from adding a new
> sock into the list concurrently. We should add a lock to protect the list.
>
For the VMCI socket transport, we always lock the sockets before calling into vsock_enqueue_accept and af_vsock.c locks the socket before calling vsock_dequeue_accept, so from our point of view these operations are already protected, but with finer granularity than a single global lock. As far as I can see, the virtio transport also locks the socket before calling vsock_enqueue_accept, so they should be fine with the current version as well, but Stefan can comment on that.
Thanks,
Jorgen
next prev parent reply other threads:[~2017-08-17 12:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 22:15 Dexuan Cui
2017-08-17 12:43 ` Jorgen S. Hansen [this message]
2017-08-18 0:37 ` Dexuan Cui
2017-08-17 14:05 ` Stefan Hajnoczi
2017-08-18 21:13 ` Dexuan Cui
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=E062F976-DF33-46CB-AB17-07F014AE138A@vmware.com \
--to=jhansen@vmware.com \
--cc=apw@canonical.com \
--cc=asias@redhat.com \
--cc=cavery@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=dave.scott@docker.com \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=georgezhang@vmware.com \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=jasowang@redhat.com \
--cc=joe@perches.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.cerri@canonical.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=rolf.neugebauer@docker.com \
--cc=stefanha@redhat.com \
--cc=sthemmin@microsoft.com \
--cc=vkuznets@redhat.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
Powered by JetHome