Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp37116pxb; Wed, 4 Nov 2020 13:46:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCcWFPnZUT9B44aQ+laG6ZiouWX7TwjToZDIESt1T3FBcquC49tUAWt1hBQ3nUTpTM6ORr X-Received: by 2002:a50:9518:: with SMTP id u24mr25790714eda.124.1604526393006; Wed, 04 Nov 2020 13:46:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604526392; cv=none; d=google.com; s=arc-20160816; b=jtuwqUXQzSzUkgo9oyTHIggC8W/JkvNA6EC31Ln/M3ZXGf0RG4mKBzKz/CK2wmzdVM k0L94HnZRFAZI0K2U3dNhXwlXnRPbptsI++As03qLXGr35sqzJMkWdgHO4YKIQlIiM1O WkPPILxJZoZ7c+fFAL9+zwl+ofI0Zfm69cBPZXfpTie14piz9AjgayUgiDLFM4EzSHqC VmW/VoWstQKfPl5n2N4zmi/zou1IUE5Loc1FkSK/GHFrcKMdvCtet98at9bg4jHeTZ2D rhMZEaKtY8JT6SsWm6GR5uxSiRUg40cb+p4BhMNUkaYul82doxrO/xWyADgT3kadg/eq w2/g== 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=/8fvmayG6zB5WwFmxBeTwgZ10W1ohtGviuIAH3Gm11Y=; b=qj1Suh3wri6GEbhIQ3bzd0hrbbLf26ZlnZyC+Fx3xWnc+OAs46eueATeEi/YzHVJWL jFRK4mEuuabRyHSIJ9iETLgEIUktah/xVQzQpz27tK13Cd/zYZNV7fQ1YMQmsBkLBsDH UC6kJHNrfYS48KppBBlvNkierUO12eo+QsBTcoaAykfBF/1koUgMiZKW+vFDOG+4i+xj Mp9h8RlbCiKdJQ7dmctpa96NhsmWIFQN3FiWIi2Ek0VjVy5V7ZqcRD1G7njENpGdFvqo DPaxkq0T2F0fBzbXTZ23EJICjqcmjBrf7QShl3A4X9B17aEITiXtvvIZVAdfSyTtEDs3 Wigw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T9mfSpoX; 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 r19si2290417ejr.323.2020.11.04.13.46.10; Wed, 04 Nov 2020 13:46:32 -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=T9mfSpoX; 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 S1731555AbgKDVnv (ORCPT + 99 others); Wed, 4 Nov 2020 16:43:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:41448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727698AbgKDVnu (ORCPT ); Wed, 4 Nov 2020 16:43:50 -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 8CB8520870; Wed, 4 Nov 2020 21:43:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604526230; bh=otuhSfW3G8tjw+/QZTQsLB2tSvizENX4OYLWU4YtJO4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=T9mfSpoXW4uYnMIGVevkGnCZL1dOFsREeDhQIN0ZanDtJWPKU/h5qsO41ABSGt+ud SCF2OvwbQ5G8znAcLaGp5nKlCJeZ0jRrlUAJp3nuHS/aSvc0dgXUY3pcHBrZ109r/b eH3ZatB4JkszV0CMNuJQMmtfjJTdAtfO1CY/TvH0= Date: Wed, 4 Nov 2020 13:43:48 -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: <20201104134348.39feba74@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20201104154027.319432-4-parri.andrea@gmail.com> References: <20201104154027.319432-1-parri.andrea@gmail.com> <20201104154027.319432-4-parri.andrea@gmail.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 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]? > @@ -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.