lkml.org 
[lkml]   [2017]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH net-next 2/3] vsock: fix vsock_dequeue/enqueue_accept race
Date
> > 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.
>
> Jorgen

Hi Jorgen,
Thanks, you're correct.
Please ignore this patch. I'll update the hv_sock driver to add proper
lock_sock()/relesae_sock().

Thanks,
-- Dexuan

\
 
 \ /
  Last update: 2017-08-18 02:39    [W:0.121 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site