Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4876429pjb; Mon, 27 Jul 2020 07:23:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVZXop9RuKGtoKhTtm56ufniaH/EFmwyzb6N1pjQcS1rfuZZcmXrqSe44AFlN0Wxl22cTR X-Received: by 2002:a17:906:e10e:: with SMTP id gj14mr2111216ejb.218.1595859800768; Mon, 27 Jul 2020 07:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859800; cv=none; d=google.com; s=arc-20160816; b=eKHSIfXaxUL/eAr0l30xhb1Mcq9c+0oDS9u3yFmbC3FL5XEPoCF3jXCrI8wlZGg9wM r39gTe/VafwM3gPC8lBLFyVjmnRtcY2HlOq3fUSePZ9gV+35BluJdv0eOVbhfY33jDNZ Qn5rrbjsgSSEAW9EOUnNZ8Iw57VAvJYs+JKkUNJZE0BQEhC5p2Om3/8t5YMChdgGMf19 0vxYJTeu+SjGVafty1YjT+36CuLWmvdv5AbUSD/BdK6QgFELRW1FS0P+JvPKsXCw9ax2 3T8hpYR5rJfDcsos3z7O/gBMmoQjAgeptqvp7P3Z6PSnlQNlsMyti1hTpngrEj3ZxU1K 8ncA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=n0tGeoJfmdgdhFY7Rxt2xZXrlAQlGi739N06G6M1M6c=; b=UbratQjUu2O93iRTt8/njMBPgOFQQYU4o3Z9qRh/vfxnuaOPTs6PO/I0tvbhG8vXnc HsRu6OoF2k7x5KXCJOeKTRpkKBmy2QmOc8H3bPPCYjAeL37JjYfpkdLekBmlO0ZeTt5M BDP6X41fJCtqm0BXn3nP4VVgyDV63gq7IZjh8e6TPtK5OEHy7iHBUT4wMs3X1UMzSOBI SRkTx9+tHdQQlxFzCFr/x1/6KWOKpu8mKeAszZj8IZlu8EHtIAWtIi96na4jghMejj2r WHP2w7L8jwDjctN66bQSoP2mLMbwxBwvvjpt9XmXCwWJ+QJJOoOM8Fc/Rn4MzDZtSfSI 4RKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rLzg6Ebq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n3si5396302edv.602.2020.07.27.07.22.58; Mon, 27 Jul 2020 07:23:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rLzg6Ebq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731749AbgG0OVh (ORCPT + 99 others); Mon, 27 Jul 2020 10:21:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:50168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730258AbgG0OVe (ORCPT ); Mon, 27 Jul 2020 10:21:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6DADC2070B; Mon, 27 Jul 2020 14:21:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859692; bh=qZ/q8yUYZulNBOTbHyiSlh+qQ7ws0lW90pxD72l4R9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rLzg6Ebq2TheqrePFb87qusuHZwmnoCiyrBb2bLPTJRB8vCi9rrMdDAUQG6hLFNyT dRXienJvQt/ulV3Lg0H9rwhTc4N0fNAjVSA1kWlj1Z6k8k/9ACWcAoOCMws9ahOrCa UBh69c4rq7M8U2WufZlkURiYAKLXeGA0oz5R1TDI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Michael S. Tsirkin" , Stefano Garzarella , Stefan Hajnoczi , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.7 051/179] vsock/virtio: annotate the_virtio_vsock RCU pointer Date: Mon, 27 Jul 2020 16:03:46 +0200 Message-Id: <20200727134935.154462720@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefano Garzarella [ 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 Signed-off-by: Stefano Garzarella Reviewed-by: Stefan Hajnoczi Acked-by: Michael S. Tsirkin Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/vmw_vsock/virtio_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 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 { -- 2.25.1