Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp37457pxb; Wed, 4 Nov 2020 13:47:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJw38LlnAzKGW4rQ8DdkfBPlyMZ3Mio8qzOPDkmZCffMUJmTZ1BORXO3WnYupbLOUc/UTsO8 X-Received: by 2002:a50:dac9:: with SMTP id s9mr28045614edj.75.1604526441871; Wed, 04 Nov 2020 13:47:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604526441; cv=none; d=google.com; s=arc-20160816; b=mgEfEfq/c8QT2Io09LeQZZ/AP5YkaZU25DIjEoR4qmMHjFRLg+hSztetqbmCWSMhpS lk+2IVSYzfQCetC5O0GpGA8gO1cqGTFqKcx55Gpw5DVLpX8pQa1fzXJe5tEUaEgpyNVe 00KFlJO+x6jgR3EOaWMOXOAXRpGiAVazCCIXeqVKScd3cpdQsNl/1cujfotpHjSbdCZE 7Gj9YsQEPVBcz+FmRwNPS+1yg0BTGi3eogzoetlokS0M32dSWMg9ej05I0ih8svFT+4H k9mSe9FWnJp5qpy5riPHWs9l0yKncO8Ry91wRMxjzAuFJ5zkluIqj/Srfb6t56XrSwO0 FnHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=6tMRJUHQl3q8ovgcahftVxJWOhO/LLx9X5lEuBf34SA=; b=xK1O/ZJA9R3qFdEP9giIKYJolIgzwujCws6zfP9XcUg8I6ZysnpipFzb/8je4efdgj 1HVR6Xc9PEcp1f4gzZlOcebKvJocijHIy2vQG2goyeXjxV2HxrJ1U/ucmN32/9mkvZlK A24eIHNouGs+dSU6jjxTHJo8C5nt7/uH07GVG+OOH4+4mTm/stq+QCBE4fED0hnDLFNA cgfaVowdB47vqoYIDPguFGMCgR8WWGjD0xU/Q6fO45WNucTjOOLZLDTYh3iINM1CMNv0 wq1ApptueOVfWUD70ZtFBKNkRuPGCsLxZU0e7b7Zn/2X1lL1NMGovld5YrzqyRpDnAMg NmLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ERvEUvI4; 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 e2si2144193edc.604.2020.11.04.13.46.56; Wed, 04 Nov 2020 13:47:21 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ERvEUvI4; 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 S1731831AbgKDVpI (ORCPT + 99 others); Wed, 4 Nov 2020 16:45:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:41666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbgKDVpI (ORCPT ); Wed, 4 Nov 2020 16:45:08 -0500 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.4]) (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 B054E20825; Wed, 4 Nov 2020 21:45:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604526307; bh=S7G/6Z/uoDypcqhu9TdumggXLTr1vz1Hqg6PCwFObro=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ERvEUvI40ukUgakQMAlNLgl4+XiIRnhwqIlwO3e7WHcu9/X2caevupQUYApGqU3wY KVZbhhRydwDaY1FVBRsl2EWqfVYJZzCHj+JcRe3x6OXPBTQkTb7/0L19fQzGENyxdD tFAud48HqBCLjC9teUlzCMADrPJQjYNvPJnSepaQ= Date: Wed, 4 Nov 2020 13:45:05 -0800 From: Jakub Kicinski To: "Andrea Parri (Microsoft)" Cc: linux-kernel@vger.kernel.org, "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , linux-hyperv@vger.kernel.org, Andres Beltran , Michael Kelley , Saruhan Karademir , Juan Vazquez , "David S. Miller" , netdev@vger.kernel.org Subject: Re: [PATCH v8 3/3] hv_netvsc: Use vmbus_requestor to generate transaction IDs for VMBus hardening Message-ID: <20201104134505.44d8c4d7@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20201104134348.39feba74@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> References: <20201104154027.319432-1-parri.andrea@gmail.com> <20201104154027.319432-4-parri.andrea@gmail.com> <20201104134348.39feba74@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Nov 2020 13:43:48 -0800 Jakub Kicinski wrote: > On Wed, 4 Nov 2020 16:40:27 +0100 Andrea Parri (Microsoft) wrote: > > From: Andres Beltran > > > > Currently, pointers to guest memory are passed to Hyper-V as > > transaction IDs in netvsc. In the face of errors or malicious > > behavior in Hyper-V, netvsc should not expose or trust the transaction > > IDs returned by Hyper-V to be valid guest memory addresses. Instead, > > use small integers generated by vmbus_requestor as requests > > (transaction) IDs. > > > > Signed-off-by: Andres Beltran > > Co-developed-by: Andrea Parri (Microsoft) > > Signed-off-by: Andrea Parri (Microsoft) > > Reviewed-by: Michael Kelley > > I'm assuming this is targeting net-next? If so could you please tag it > as [PATCH net-next vN]? Ah, you don't 'cause you only sent us the third patch. In that case with the nit below addressed: Acked-by: Jakub Kicinski > > @@ -695,10 +695,19 @@ static void netvsc_send_tx_complete(struct net_device *ndev, > > const struct vmpacket_descriptor *desc, > > int budget) > > { > > - struct sk_buff *skb = (struct sk_buff *)(unsigned long)desc->trans_id; > > + struct sk_buff *skb; > > struct net_device_context *ndev_ctx = netdev_priv(ndev); > > Swap these two lines please to keep the variables declaration lines > longest to shortest.