[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200713092839.GD28639@stefanha-x1.localdomain>
Date: Mon, 13 Jul 2020 10:28:39 +0100
From: Stefan Hajnoczi <stefanha@...hat.com>
To: Stefano Garzarella <sgarzare@...hat.com>
Cc: davem@...emloft.net, virtualization@...ts.linux-foundation.org,
"Michael S. Tsirkin" <mst@...hat.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>, kvm@...r.kernel.org
Subject: Re: [PATCH] vsock/virtio: annotate 'the_virtio_vsock' RCU pointer
On Fri, Jul 10, 2020 at 02:12:43PM +0200, Stefano Garzarella wrote:
> Commit 0deab087b16a ("vsock/virtio: use RCU to avoid use-after-free
> on the_virtio_vsock") starts to use RCU to protect 'the_virtio_vsock'
> pointer, but we forgot to annotate it.
>
> This patch adds the annotation to fix the following sparse errors:
>
> net/vmw_vsock/virtio_transport.c:73:17: error: incompatible types in comparison expression (different address spaces):
> net/vmw_vsock/virtio_transport.c:73:17: struct virtio_vsock [noderef] __rcu *
> net/vmw_vsock/virtio_transport.c:73:17: struct virtio_vsock *
> net/vmw_vsock/virtio_transport.c:171:17: error: incompatible types in comparison expression (different address spaces):
> net/vmw_vsock/virtio_transport.c:171:17: struct virtio_vsock [noderef] __rcu *
> net/vmw_vsock/virtio_transport.c:171:17: struct virtio_vsock *
> net/vmw_vsock/virtio_transport.c:207:17: error: incompatible types in comparison expression (different address spaces):
> net/vmw_vsock/virtio_transport.c:207:17: struct virtio_vsock [noderef] __rcu *
> net/vmw_vsock/virtio_transport.c:207:17: struct virtio_vsock *
> net/vmw_vsock/virtio_transport.c:561:13: error: incompatible types in comparison expression (different address spaces):
> net/vmw_vsock/virtio_transport.c:561:13: struct virtio_vsock [noderef] __rcu *
> net/vmw_vsock/virtio_transport.c:561:13: struct virtio_vsock *
> net/vmw_vsock/virtio_transport.c:612:9: error: incompatible types in comparison expression (different address spaces):
> net/vmw_vsock/virtio_transport.c:612:9: struct virtio_vsock [noderef] __rcu *
> net/vmw_vsock/virtio_transport.c:612:9: struct virtio_vsock *
> net/vmw_vsock/virtio_transport.c:631:9: error: incompatible types in comparison expression (different address spaces):
> net/vmw_vsock/virtio_transport.c:631:9: struct virtio_vsock [noderef] __rcu *
> net/vmw_vsock/virtio_transport.c:631:9: struct virtio_vsock *
>
> Fixes: 0deab087b16a ("vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock")
> Reported-by: Michael S. Tsirkin <mst@...hat.com>
> Signed-off-by: Stefano Garzarella <sgarzare@...hat.com>
> ---
> net/vmw_vsock/virtio_transport.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Stefan Hajnoczi <stefanha@...hat.com>
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists