Thread (5 messages) 5 messages, 3 authors, 2017-08-18

RE: [PATCH net-next 2/3] vsock: fix vsock_dequeue/enqueue_accept race

flat view

From: Dexuan Cui <decui@microsoft.com>
Date: 2017-08-18 21:13:29
Also in: lkml

From: Stefan Hajnoczi [mailto:stefanha@redhat.com]
Sent: Thursday, August 17, 2017 07:06

On Tue, Aug 15, 2017 at 10:15:39PM +0000, Dexuan Cui wrote:
quoted
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.
The listener sock is locked, preventing concurrent modification.  I have
checked both the virtio and vmci transports.  Can you post an example
where the listener sock isn't locked?

Stefan
Sorry, I was not careful when checking the vmci code. 
Please ignore the patch.

Now I realized the expectation is that the individual transport drivers should
do the locking for vsock_enqueue_accept(), but for vsock_dequeue_accept(),
the locking is done by the common vsock driver.

Thanks,
-- Dexuan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help