Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp732130ybh; Wed, 22 Jul 2020 11:42:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxryIV436yA6ctwZFqQe/aSHHUWXSB0e4ErOMucJ3csTn6DvC1NH1WRFPemdFS8Tom+2dHL X-Received: by 2002:a17:906:c943:: with SMTP id fw3mr884329ejb.55.1595443338341; Wed, 22 Jul 2020 11:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595443338; cv=none; d=google.com; s=arc-20160816; b=yFIhGVUx+5vm2AdDO/HzIstJy/xEX3d9Z1yKpnpmt06remoiTUW1Dm5jtR0ya7wMql QPSkmnkINRZFtiMkf+G/kqVvzJqoczTW51pJPqCKeUEMvOjeKDioZsxLcnlsSMn9+aX+ MdhqDP3ZCDNt1lGsU6eU70w856X+WjFn1BKGYtcm2BenGLrAo2Bmv4opj04bjJPk6ED1 6PdHThIM4pROXs1/7N/CEAVQKySpxJHf2zWLsYuCQ/eHUaPWb4QL45hyxWA1qTV5g4Av 7uiAs2wZ4c6zIHro50oVifQARct5m5Q8YoBgbcmIsd13vJemXb2PXUlL4QwKorAMrrAg WQHA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=B9NmDFLAg+S5lUz7K2pvf1RhE94Cz0luh7cCv2JHKXA=; b=P0/+Z2f/GeAQAA3lKQrcz5jAyfqEbTu0UYb/Tcmw/kxNdmysDFBlhn6DLZziMuvFsc M2vbvuU1G971+L00HrbV1O2kHXz59bDIa+yHMGPmFYH9w7YX6kYTYppffKDRdSTp3Mwu e6PXBbBmqYoK0elSE86H/5AzeQMeUukaAA3EolMxyUceHDKWwm4o5i7OJT0Qja9apNIx TM2TGHfnll/hWLSUsgqWnXAeKgOeXbTkTBZoMKgPy3N4Zk0QZ3U0/F62YoUbnfkLrjgd a4ei2LXEPz1uwvVmLyXbVjnPMgMt77s0sun/eApwnb56F4C0Rlgn20w0qTKrXsbEqTzn /t8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=MQp8z9MQ; 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 gj23si548397ejb.21.2020.07.22.11.41.55; Wed, 22 Jul 2020 11:42:18 -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=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=MQp8z9MQ; 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 S1732387AbgGVSko (ORCPT + 99 others); Wed, 22 Jul 2020 14:40:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbgGVSko (ORCPT ); Wed, 22 Jul 2020 14:40:44 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 317D0C0619DC for ; Wed, 22 Jul 2020 11:40:44 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id w2so1749948pgg.10 for ; Wed, 22 Jul 2020 11:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B9NmDFLAg+S5lUz7K2pvf1RhE94Cz0luh7cCv2JHKXA=; b=MQp8z9MQbjNzSSgYFwXVflDMZXY4DvuxHtdAXlCmLFxx0hOtegVLhCBZUQ9TLduLz5 ahZ3TrUoGAUsC1cMno4k0/T8sWa/5T9W9ohDh5NvhVKcAtDnl1MQ/kJKKgKgorwYvdMH IgJukohrmjsI1i8pALKgQ2CCs+bl75yZzQseWKIAQ2u0itey7ajZ2NsPdWB528iAEyNN 9i9gQ+MK49i5GAVGKtTrWlcFURx/zBexDaIR5Bkow+ASqjSS1QvNtQsT0PewqGa4UHoC KUWrDiFfrrigWke+quMV9W7DkPWApb7WxckAiF9APlR49Q9UnuT4d01yBiFAknTR8HC6 yX/w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=B9NmDFLAg+S5lUz7K2pvf1RhE94Cz0luh7cCv2JHKXA=; b=fUiuVLif+eUcs0/k89a6s2T/3mDGDYN+OKVFXC4v5HB67bAZzSI6FbVQ676ZWMQD+B OkNZmdDcMI5V33+FEWNq/9aoZWdHb2FnN7TpX9ecSooI+6HcBY4ojJWJ/gcqriEd+ZKR l6CHbSDWrEDq/Dq3jSAs7yfYQZ1aBL15KGgG6YX+ep6ptUWEJYGCWgQNstPYpG2O4nix E7xAd36ANyfgQbTVZDL1Z7UMPgQBmI9JmDCteo4ednRIKMs3/kAK3T3RAiQP4TuhXR1D e7RQSAe9A/lO589VG3r6aR01CnM2TsBHT1W9UTllFa72Z+uQ/jhov+2uEP0OnXy5HmMy fGZg== X-Gm-Message-State: AOAM532Ugb1Kz7TOBsY+jNt+ZAo/xmw3U1GwzZkBPjZGC+rXyhacRins czjrLw8Eyf2D2q1mXHfO673jrg== X-Received: by 2002:a63:c58:: with SMTP id 24mr963125pgm.343.1595443243660; Wed, 22 Jul 2020 11:40:43 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id r70sm324144pfc.109.2020.07.22.11.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 11:40:43 -0700 (PDT) Date: Wed, 22 Jul 2020 11:40:34 -0700 From: Stephen Hemminger To: "Andres Beltran" Cc: "Andres Beltran" , "KY Srinivasan" , "Haiyang Zhang" , "Stephen Hemminger" , , , , "Michael Kelley" , , "James E . J . Bottomley" , "Martin K . Petersen" , "David S . Miller" Subject: Re: [PATCH v5 0/3] Drivers: hv: vmbus: vmbus_requestor data structure for VMBus hardening Message-ID: <20200722114034.443f5af2@hermes.lan> In-Reply-To: <20200722181051.2688-1-lkmlabelt@gmail.com> References: <20200722181051.2688-1-lkmlabelt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 Jul 2020 11:10:48 -0700 "Andres Beltran" wrote: > Currently, VMbus drivers use pointers into guest memory as request IDs > for interactions with Hyper-V. To be more robust in the face of errors > or malicious behavior from a compromised Hyper-V, avoid exposing > guest memory addresses to Hyper-V. Also avoid Hyper-V giving back a > bad request ID that is then treated as the address of a guest data > structure with no validation. Instead, encapsulate these memory > addresses and provide small integers as request IDs. > > The first patch creates the definitions for the data structure, provides > helper methods to generate new IDs and retrieve data, and > allocates/frees the memory needed for vmbus_requestor. > > The second and third patches make use of vmbus_requestor to send request > IDs to Hyper-V in storvsc and netvsc respectively. > > Thanks. > Andres Beltran > > Cc: James E.J. Bottomley > Cc: Martin K. Petersen > Cc: David S. Miller > > Andres Beltran (3): > Drivers: hv: vmbus: Add vmbus_requestor data structure for VMBus > hardening > scsi: storvsc: Use vmbus_requestor to generate transaction IDs for > VMBus hardening > hv_netvsc: Use vmbus_requestor to generate transaction IDs for VMBus > hardening > > drivers/hv/channel.c | 175 ++++++++++++++++++++++++++++++ > drivers/net/hyperv/hyperv_net.h | 13 +++ > drivers/net/hyperv/netvsc.c | 79 +++++++++++--- > drivers/net/hyperv/rndis_filter.c | 1 + > drivers/scsi/storvsc_drv.c | 85 +++++++++++++-- > include/linux/hyperv.h | 22 ++++ > 6 files changed, 350 insertions(+), 25 deletions(-) > What is the performance impact of this? It means keeping a global (bookkeeping) structure which should have noticeable impact on mult-queue performance.