Patch "vsock/virtio: annotate 'the_virtio_vsock' RCU pointer" has been added to the 5.7-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    vsock/virtio: annotate 'the_virtio_vsock' RCU pointer

to the 5.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     vsock-virtio-annotate-the_virtio_vsock-rcu-pointer.patch
and it can be found in the queue-5.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 03adcc0d21f0f8e83150fb8b57b7861bbb5d324d
Author: Stefano Garzarella <sgarzare@xxxxxxxxxx>
Date:   Fri Jul 10 14:12:43 2020 +0200

    vsock/virtio: annotate 'the_virtio_vsock' RCU pointer
    
    [ Upstream commit f961134a612c793d5901a93d85a29337c74af978 ]
    
    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@xxxxxxxxxx>
    Signed-off-by: Stefano Garzarella <sgarzare@xxxxxxxxxx>
    Reviewed-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
    Acked-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index dfbaf6bd8b1c7..2700a63ab095e 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -22,7 +22,7 @@
 #include <net/af_vsock.h>
 
 static struct workqueue_struct *virtio_vsock_workqueue;
-static struct virtio_vsock *the_virtio_vsock;
+static struct virtio_vsock __rcu *the_virtio_vsock;
 static DEFINE_MUTEX(the_virtio_vsock_mutex); /* protects the_virtio_vsock */
 
 struct virtio_vsock {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux