Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp521134ybh; Wed, 15 Jul 2020 08:09:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPU4Usvek1SqT34yNNl31fm1YniDsvCwlTondfU6qlwz3fhduBJmRvWEtOPGDhwnVVa2Le X-Received: by 2002:a50:fd07:: with SMTP id i7mr52666eds.221.1594825796657; Wed, 15 Jul 2020 08:09:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594825796; cv=none; d=google.com; s=arc-20160816; b=Vcq1NQLssKvsVrs81pc1Li0LEh0cItR/mw2/ZHNQtAXwoghEwMIAhs34oLS1eldVf/ 0XQo0wq8KTv8UehPhillQNrGLdTqHxBmPc/3W8sM8K3yuGHMDbewhcQJqVtJKIG+DIJc ZUkObeSbBTxTWAyMLbkzvsq/xXKUUFvezwoEASddDBjXt78Ue+NMv377Ob4vY0twuhXo a/6ExF0k63WU2sTx+YQCxhmLjTM93BWJlbAzEpRXQ8GPjVwdjtgVZJ8DHejXS5eGiSw+ 6DHwvWmNOaX7ypyVmlfFIubO3uenpdU/iewC19zPtnGCdr83GmtCrX2Aa5chuB5v7xAV zEew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gDUnF1gX4Wln5UGQpyw0DsCZrmXKbH1BJblX2g4HkKY=; b=pho8gvJFI9ZS9JAVG8/0HQ4zaMaPSgATWws1jXbIXKJrVHEsxYrxR5elyCrJXGChrY kta1bGimqN+KSW/4/kVtv1ls0p5Ti/tOeV5obYcEXX0LbccwNR12/A8H4ELZ4mBBipni IO6hoWF9UGei7KHL8nr/toJt+xtiCAXSYofj+UYradDYYD1Bd1Mls3zq5Mc/Ayd6aBOp SWM6Df5YEHYHQ4z2jzQvBzKcv1plCUGu6G1rVnNWG3ndc0/2cHolE/Z6exMYDgXiopKp TJIJXkpb3Y/wdb2VTyUMY9xU/F4ZJNHg1Ib5roj8O17pS2u/8Jqj2OeIw5O4i+tqcd4H oLMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f4y0MJ3b; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk25si1398339edb.28.2020.07.15.08.09.30; Wed, 15 Jul 2020 08:09:56 -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=@redhat.com header.s=mimecast20190719 header.b=f4y0MJ3b; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728824AbgGOOe5 (ORCPT + 99 others); Wed, 15 Jul 2020 10:34:57 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:52743 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727999AbgGOOe4 (ORCPT ); Wed, 15 Jul 2020 10:34:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594823694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gDUnF1gX4Wln5UGQpyw0DsCZrmXKbH1BJblX2g4HkKY=; b=f4y0MJ3byWsV/c4dAXaj0GExpxt5+5duSytOqyGeKX81CrDbxYHEgsCJKlhVLIiY5repuM tyPsJieTetq38kzbJphGXoiQU/TOUJLab9kMaCkFuvePxux1RDhT5Jnjwp64ck1emlaNeZ plbHhPoIRGMOaayDZxYSAG/FqKXS/Io= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-219-TSvnWXXxPd-x98TyeIwnYQ-1; Wed, 15 Jul 2020 10:34:52 -0400 X-MC-Unique: TSvnWXXxPd-x98TyeIwnYQ-1 Received: by mail-wm1-f70.google.com with SMTP id c81so1181201wmd.2 for ; Wed, 15 Jul 2020 07:34:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gDUnF1gX4Wln5UGQpyw0DsCZrmXKbH1BJblX2g4HkKY=; b=jjM3/dLquQepEItOCoFagnT21Oc7cOiuhT6Z41uXuXeIeE/v0taddsoBI+sctdFKtE /dTV85PmHD0TxqO31DjMx5j8F5/kr5Xu7w96iJs5okChGTIhNxE0CYWcUG/7V/HpXqJK GeYK3ycYn2MchwdW9OdYfuxc5ib1yRUIovCemDRb2R7OIpYmDuD4aciSP2Rj76RKGS4r AZ/w8c9RuDBsgGthXqnrrQlixT0eWm1R5QnzpAUQba2RP6V3MYzSCRpN4/6gvI79yz8j v/SNOXqhnxGxZ7UM+qZcOQHwkqVYqoZf799OKCo9MQJF73GX9ZwZK1BY6USSomFEuosI 3lhQ== X-Gm-Message-State: AOAM532WN1dHOS1sLKVpLwbYeMsUj+IZ2J+Qc9gR5q/ETS5CKokAWdhi govVGRnoi6twZ8pfNHPfQ8j6E1QuEV+jPclW8HZ0ikXT206FbxRfj4V/2B1xeqNG6H3yOlDijIg wToE4vhH+45p320obxvXMssXz X-Received: by 2002:a5d:6987:: with SMTP id g7mr11513365wru.79.1594823691729; Wed, 15 Jul 2020 07:34:51 -0700 (PDT) X-Received: by 2002:a5d:6987:: with SMTP id g7mr11513341wru.79.1594823691514; Wed, 15 Jul 2020 07:34:51 -0700 (PDT) Received: from steredhat ([5.180.207.22]) by smtp.gmail.com with ESMTPSA id e8sm3600980wrp.26.2020.07.15.07.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 07:34:50 -0700 (PDT) Date: Wed, 15 Jul 2020 16:34:46 +0200 From: Stefano Garzarella To: "Michael S. Tsirkin" , davem@davemloft.net Cc: davem@davemloft.net, Stefan Hajnoczi , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Jakub Kicinski , kvm@vger.kernel.org Subject: Re: [PATCH] vsock/virtio: annotate 'the_virtio_vsock' RCU pointer Message-ID: <20200715143446.kfl3zb4vwkk4ic4r@steredhat> References: <20200710121243.120096-1-sgarzare@redhat.com> <20200713065423-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200713065423-mutt-send-email-mst@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 13, 2020 at 06:54:43AM -0400, Michael S. Tsirkin wrote: > 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 > > Signed-off-by: Stefano Garzarella > > > Acked-by: Michael S. Tsirkin > > who's merging this? Dave? I think so, but I forgot the 'net' tag :-( I'll wait to see if Dave will queue this, otherwise I'll resend with the 'net' tag. Thanks, Stefano