RE: [PATCH v3] virtio_vsock: Fix race condition in virtio_transport_recv_pkt()

From: Justin He
Date: Sat May 30 2020 - 08:26:49 EST


Hi Markus

> -----Original Message-----
> From: Markus Elfring <Markus.Elfring@xxxxxx>
> Sent: Saturday, May 30, 2020 6:41 PM
> To: Justin He <Justin.He@xxxxxxx>; kvm@xxxxxxxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
> Cc: kernel-janitors@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> stable@xxxxxxxxxxxxxxx; David S. Miller <davem@xxxxxxxxxxxxx>; Jakub
> Kicinski <kuba@xxxxxxxxxx>; Kaly Xin <Kaly.Xin@xxxxxxx>; Stefan Hajnoczi
> <stefanha@xxxxxxxxxx>; Stefano Garzarella <sgarzare@xxxxxxxxxx>
> Subject: Re: [PATCH v3] virtio_vsock: Fix race condition in
> virtio_transport_recv_pkt()
>
> > This fixes it by checking sk->sk_shutdown(suggested by Stefano) after
> > lock_sock since sk->sk_shutdown is set to SHUTDOWN_MASK under the
> > protection of lock_sock_nested.
>
> How do you think about a wording variant like the following?
>
> Thus check the data structure member âsk_shutdownâ (suggested by Stefano)
> after a call of the function âlock_sockâ since this field is set to
> âSHUTDOWN_MASKâ under the protection of âlock_sock_nestedâ.
>
Okay, will update the commit msg.

>
> Would you like to add the tag âFixesâ to the commit message?
Sure.

Thanks


--
Cheers,
Justin (Jia He)


>
> Regards,
> Markus
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.