Re: [PATCH net] vsock: fix locking in vsock_shutdown()

2021-02-09 Thread Stefano Garzarella
On Mon, Feb 08, 2021 at 11:12:00AM -0800, Jakub Kicinski wrote: On Mon, 8 Feb 2021 16:04:31 +0100 Stefano Garzarella wrote: What do you suggest? I did it this way because by modifying only the caller, we would have a nested lock. This way instead we are sure that if we backport this patch, we

Re: [PATCH net] vsock: fix locking in vsock_shutdown()

2021-02-08 Thread Jakub Kicinski
On Mon, 8 Feb 2021 16:04:31 +0100 Stefano Garzarella wrote: > What do you suggest? > > I did it this way because by modifying only the caller, we would have a > nested lock. > > This way instead we are sure that if we backport this patch, we don't > forget to touch hvs_shutdown() as well. I'm

Re: [PATCH net] vsock: fix locking in vsock_shutdown()

2021-02-08 Thread Stefano Garzarella
On Mon, Feb 08, 2021 at 03:43:07PM +0100, Stefano Garzarella wrote: In vsock_shutdown() we touched some socket fields without holding the socket lock, such as 'state' and 'sk_flags'. Also, after the introduction of multi-transport, we are accessing 'vsk->transport' in vsock_send_shutdown() witho

[PATCH net] vsock: fix locking in vsock_shutdown()

2021-02-08 Thread Stefano Garzarella
In vsock_shutdown() we touched some socket fields without holding the socket lock, such as 'state' and 'sk_flags'. Also, after the introduction of multi-transport, we are accessing 'vsk->transport' in vsock_send_shutdown() without holding the lock and this call can be made while the connection is