Skip to content
  • Stefano Garzarella's avatar
    vsock/virtio: annotate 'the_virtio_vsock' RCU pointer · f961134a
    Stefano Garzarella authored
    Commit 0deab087 ("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: 0deab087
    
     ("vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock")
    Reported-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    f961134a