RE: [PATCH v2] virtio_vsock: Fix race condition in virtio_transport_recv_pkt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Stefano Garzarella <sgarzare@xxxxxxxxxx>
> Sent: Friday, June 5, 2020 10:30 PM
> To: Sasha Levin <sashal@xxxxxxxxxx>
> Cc: Justin He <Justin.He@xxxxxxx>; Stefan Hajnoczi <stefanha@xxxxxxxxxx>;
> David S. Miller <davem@xxxxxxxxxxxxx>; stable@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v2] virtio_vsock: Fix race condition in
> virtio_transport_recv_pkt
>
> On Fri, Jun 05, 2020 at 02:10:49PM +0000, Sasha Levin wrote:
> > Hi
> >
> > [This is an automated email]
> >
> > This commit has been processed because it contains a -stable tag.
> > The stable tag indicates that it's relevant for the following trees: all
> >
> > The bot has tested the following trees: v5.6.15, v5.4.43, v4.19.125,
> v4.14.182, v4.9.225, v4.4.225.
> >
> > v5.6.15: Build OK!
> > v5.4.43: Build failed! Errors:
> >     net/vmw_vsock/virtio_transport_common.c:1109:40:
> error: ???????????????t?????????????????? undeclared (first use in this
> function); did you mean ???????????????tm???????????????????
> >     net/vmw_vsock/virtio_transport_common.c:1109:9: error: too many
> arguments to
> function ???????????????virtio_transport_reset_no_sock??????????????????
> >
> > v4.19.125: Build failed! Errors:
> >     net/vmw_vsock/virtio_transport_common.c:1042:40:
> error: ???????????????t?????????????????? undeclared (first use in this
> function); did you mean ???????????????tm???????????????????
> >     net/vmw_vsock/virtio_transport_common.c:1042:9: error: too many
> arguments to
> function ???????????????virtio_transport_reset_no_sock??????????????????
> >
> > v4.14.182: Build failed! Errors:
> >     net/vmw_vsock/virtio_transport_common.c:1038:40:
> error: ???????????????t?????????????????? undeclared (first use in this
> function); did you mean ???????????????tm???????????????????
> >     net/vmw_vsock/virtio_transport_common.c:1038:9: error: too many
> arguments to
> function ???????????????virtio_transport_reset_no_sock??????????????????
> >
> > v4.9.225: Build failed! Errors:
> >     net/vmw_vsock/virtio_transport_common.c:968:40:
> error: ???????????????t?????????????????? undeclared (first use in this
> function); did you mean ???????????????tm???????????????????
> >     net/vmw_vsock/virtio_transport_common.c:968:9: error: too many
> arguments to
> function ???????????????virtio_transport_reset_no_sock??????????????????
> >
> > v4.4.225: Failed to apply! Possible dependencies:
> >     06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko")
> >
> >
> > NOTE: The patch will not be queued to stable trees until it is upstream.
> >
> > How should we proceed with this patch?
>
> I think we can simply remove the 't' from virtio_transport_reset_no_sock(),
> the following patch should work:
>
> diff --git a/net/vmw_vsock/virtio_transport_common.c
> b/net/vmw_vsock/virtio_transport_common.c
> index fb2060dffb0a..17f4c93f5e75 100644
> --- a/net/vmw_vsock/virtio_transport_common.c
> +++ b/net/vmw_vsock/virtio_transport_common.c
> @@ -1104,6 +1104,14 @@ void virtio_transport_recv_pkt(struct
> virtio_vsock_pkt *pkt)
>
>         lock_sock(sk);
>
> +       /* Check if sk has been released before lock_sock */
> +       if (sk->sk_shutdown == SHUTDOWN_MASK) {
> +               (void)virtio_transport_reset_no_sock(pkt);
> +               release_sock(sk);
> +               sock_put(sk);
> +               goto free_pkt;
> +       }
> +
Thanks Stefano,
Yes, this (t) parameter changes is introduced after 4c7246dc45e27 (v5.4-rc6-1712).
So the stable tree (version less than v5.4) should apply above patch.

Sorry for my late response, the auto mail is filtered by our outlook server ☹

--
Cheers,
Justin (Jia He)


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.




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux