Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp64863pxu; Tue, 5 Jan 2021 05:23:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlj/8Grh/3Pce5c25pLbxvjlG6Jm43vZ+LPIvz3+ZWvPzt0I6KBYvsNmcg0LySONyYRTLN X-Received: by 2002:a17:907:3e85:: with SMTP id hs5mr72578695ejc.548.1609853003318; Tue, 05 Jan 2021 05:23:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609853003; cv=none; d=google.com; s=arc-20160816; b=x4peEWTLtFW163CYq+5z/6fbfbcuy8IUcmO9YaSiw7dNSbZl6v+eVew+Ig1kDeX25R p2vmpr7onp/E2S4hm8ezG/GHKm2eAZuvk+x4iCWg2rDHxOwQ+6ZTvcQsIyyKDGP++OIV pjVjoyBa4S0K44TB2Hqy3hhsCr+hdq5iVYVSGsAXloxPZWbcxmcveMrAP/gDFM8EzXtW el8MyRYyJ4ZHiQIXTULIglwlyBVjeDAlmxpFNWjmGpsBjnHdnhyHZ9x0rx+RhaaZqktI kKJd+V+SK7sCcBsQnX65haonJb7RTsgD+tULeQMw92HV+bq6PlfrU9J1gCKcRrY039/x 98vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=EXnUtStgTNHCYfCXvY8ndQ5zpFOfaWr6HedodEhJISw=; b=HUjCwdzjjLZTuSVOxugasVHqyHbl+tC8lh2PPXPLquvmrLEH2gaR/lyVuoHQK2bZPI ojLtarFIkLn7ln/2AzQCLxCzAP6dbWCUFdTHVKhSyDke+xpXzwoxXUp3VJIEYg+bePnp +okEX4sfv377V2pMqOHpCiKSw8dxc8a7mCoxA9WBG3v4G3cCQVo+i3OVTURhyVGc8OG7 YMQzmZXVflalk6VUF+VNfrZfgzHdkpIpZlI3Leuv1pF+vJP2+gNaoVAFRLQJ0nF3e61N cyPZMb45WT8NYnt5Cuyevszl6/7AHxoj/nhJiLgtsRNaof8xHFOHeVi1m0h1O1VkCN34 Z4bw== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si18563154ejn.628.2021.01.05.05.22.59; Tue, 05 Jan 2021 05:23:23 -0800 (PST) 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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729249AbhAEMqR (ORCPT + 99 others); Tue, 5 Jan 2021 07:46:17 -0500 Received: from mail-wm1-f41.google.com ([209.85.128.41]:50835 "EHLO mail-wm1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbhAEMqP (ORCPT ); Tue, 5 Jan 2021 07:46:15 -0500 Received: by mail-wm1-f41.google.com with SMTP id 190so2917398wmz.0; Tue, 05 Jan 2021 04:45:57 -0800 (PST) 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:user-agent; bh=EXnUtStgTNHCYfCXvY8ndQ5zpFOfaWr6HedodEhJISw=; b=CqvncFBI1odmUVtZcEfs1lg76avUWKDWIEcBFGSQp8XEzRVPy3QHSlN+ttUshaJUdQ JQJC6pUmHMJ7N+NdnC8dQ1rD7MJvZ5qI1FZtcWw+0h+toPTTpey5USLlr9NfN4H36tg6 Pxu2qadEo2gDnaegOqJ8gaXUujRVgcL4aAXrBuiTfi6d9GAIPqhpXWO+vACDnUHC6+jf yc7+GUiRYDvroSbhmJDSJROjxV5x0Nvw6Zf+7DgPif/EeeBO1Ky1eVz/BIANNELrmzsf Z0MnYK8akqvZ40nsMk7J87uN2ebQs0NoBJlDMrHSwfhmpxpXAFtjRN2mbrDJS3JuZgsr FPtA== X-Gm-Message-State: AOAM533VeeY3dqGGOj6Kege3kMeLqo9NCgP++uhjj8qvTghxV3Z+dD8L nh6rK+IE+XePP37YMzMHA9c= X-Received: by 2002:a7b:cf0d:: with SMTP id l13mr3420391wmg.168.1609850732287; Tue, 05 Jan 2021 04:45:32 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id y63sm4145232wmd.21.2021.01.05.04.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jan 2021 04:45:31 -0800 (PST) Date: Tue, 5 Jan 2021 12:45:30 +0000 From: Wei Liu To: Michael Kelley Cc: "Andrea Parri (Microsoft)" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Juan Vazquez , Saruhan Karademir , Andres Beltran , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , "netdev@vger.kernel.org" , "linux-scsi@vger.kernel.org" Subject: Re: [PATCH v3] Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer Message-ID: <20210105124530.kwaa6vdpdpopp2tq@liuwe-devbox-debian-v2> References: <20201208045311.10244-1-parri.andrea@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 22, 2020 at 01:59:34PM +0000, Michael Kelley wrote: > From: Andrea Parri (Microsoft) Sent: Monday, December 7, 2020 8:53 PM > > > > From: Andres Beltran > > > > Pointers to ring-buffer packets sent by Hyper-V are used within the > > guest VM. Hyper-V can send packets with erroneous values or modify > > packet fields after they are processed by the guest. To defend > > against these scenarios, return a copy of the incoming VMBus packet > > after validating its length and offset fields in hv_pkt_iter_first(). > > In this way, the packet can no longer be modified by the host. > > > > Signed-off-by: Andres Beltran > > Co-developed-by: Andrea Parri (Microsoft) > > Signed-off-by: Andrea Parri (Microsoft) > > Cc: "David S. Miller" > > Cc: Jakub Kicinski > > Cc: "James E.J. Bottomley" > > Cc: "Martin K. Petersen" > > Cc: netdev@vger.kernel.org > > Cc: linux-scsi@vger.kernel.org > > --- > > drivers/hv/channel.c | 9 ++-- > > drivers/hv/hv_fcopy.c | 1 + > > drivers/hv/hv_kvp.c | 1 + > > drivers/hv/hyperv_vmbus.h | 2 +- > > drivers/hv/ring_buffer.c | 82 ++++++++++++++++++++++++++----- > > drivers/net/hyperv/hyperv_net.h | 3 ++ > > drivers/net/hyperv/netvsc.c | 2 + > > drivers/net/hyperv/rndis_filter.c | 2 + > > drivers/scsi/storvsc_drv.c | 10 ++++ > > include/linux/hyperv.h | 48 +++++++++++++++--- > > net/vmw_vsock/hyperv_transport.c | 4 +- > > 11 files changed, 139 insertions(+), 25 deletions(-) > > > > Reviewed-by: Michael Kelley Applied to hyperv-next.