Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp582501ybt; Fri, 26 Jun 2020 06:45:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWdpCXowU85o61dbIj21laVf5HREDf2cRii9QTg4BcV+Dqt3rS/cL/kwvQZF+qk291gk1c X-Received: by 2002:aa7:c0c7:: with SMTP id j7mr3324045edp.242.1593179148039; Fri, 26 Jun 2020 06:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593179148; cv=none; d=google.com; s=arc-20160816; b=lzY8CDPuzE/F2xZM1Yb0TaC+z4cMd7q/2A78uFklnCpyePomamwJMwCUcrhDvvfxeH Gh1tk4PJfsAAuF7XvQKac8QgMQAPSvtSCbd6goJ8VSXtz8Z31VBmiiT8kgmBJz/4O3tA CLiPklBJEvgmYpYgKTeT12Rwvo+dyi6wCUqsq2j52xQXAx3yExrr5HJM5q/HYeapFeqc YEqCuHtxkaPSXoCkMqgiGsycEPNedPYSpKtBaokmJKC1Rsfxv985t+8tSv+I8/hORxS1 NcRs3xi8kgC+ok8PTw1ftmyhhGwpbgsbGQVBC5un+37gpkdPqSuissSSPSk2W3nwekrz 9xDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WPQDOd5p2KRBs00b1Ze0uo40/AP826N8zKgr9FyI50s=; b=gKI195OA7FbpNcdDx2btfGbO1WnlNE6qiUz6KnQxhhZmwu7Nprzhby3zwKnvXnWBuw dIgiYQiGst/Un3VYCh21ch7vmpTgYbP+9r64dvt3bZ+EpM7bjq9WIHcAntLDkHljvsaH qZmiURYr0NtsCHn0cn8GMeGYm6larS/5VTJpg+0zgXb5bKDGUHASR5PRFNUinlzrqeqx 5cWSPZ1oL3aAGYbQeDwYao7pyo3UoclM2yOPKvUoHSNRJJ3ShSLiiEmLP7UzaDn1BpA4 lvxsU7Xjc997xy/rA8aAYcR5EMgRIAbC3gkfarbXiSSwZ3i+/lIPgiv0KQZIivltAeHs e5/A== 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 t28si2867323edc.97.2020.06.26.06.45.24; Fri, 26 Jun 2020 06:45:48 -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; 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 S1728765AbgFZNmd (ORCPT + 99 others); Fri, 26 Jun 2020 09:42:33 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35921 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgFZNmb (ORCPT ); Fri, 26 Jun 2020 09:42:31 -0400 Received: by mail-wr1-f66.google.com with SMTP id k6so9574802wrn.3; Fri, 26 Jun 2020 06:42:30 -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:user-agent; bh=WPQDOd5p2KRBs00b1Ze0uo40/AP826N8zKgr9FyI50s=; b=jfBhGs+imk+4tN4veCyowN8biUmvN9sPXenb+TAKj6hEOTLB2DLlSvqb8oLXWoPhoG xm1V+2rhlmM5pZ8DAEIBd2iYccQOcFyHSIttv3rdybF1Fb7P3pRzKzu3ag7/XIJw+wF7 6+UKWyMGSAsDotXbfkH80hWeaAjuqx6F68/9QCoqrP8xfmKdugw3TmwAPGxf8HahgzJb ym250W38rMCIVCp4BUqYUqKT3Ehe7NH6j5DY0VE0EsC24Ll44yHo7GAdvlQEyToS0id0 RjKLQD810GeVWz0nLknKOYAj9vqy6zcXmU8w8NxBZc/ZrV5sZ9tYahTEBUf+FoS9zmp7 K39g== X-Gm-Message-State: AOAM531+REODMcAL1DbD+YIF/djar817iExt7qmFtYVhU1rUZFvqDbK4 q8WgVntNYfaGtn9Pa9rlSt8= X-Received: by 2002:a5d:5483:: with SMTP id h3mr3996023wrv.10.1593178949427; Fri, 26 Jun 2020 06:42:29 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id u10sm17197124wml.29.2020.06.26.06.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 06:42:29 -0700 (PDT) Date: Fri, 26 Jun 2020 13:42:27 +0000 From: Wei Liu To: Andres Beltran Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, mikelley@microsoft.com, parri.andrea@gmail.com, linux-scsi@vger.kernel.org, netdev@vger.kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" , "David S. Miller" , Jakub Kicinski Subject: Re: [PATCH 0/3] Drivers: hv: vmbus: vmbus_requestor data structure Message-ID: <20200626134227.ka4aghqjpktdupnu@liuwe-devbox-debian-v2> References: <20200625153723.8428-1-lkmlabelt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200625153723.8428-1-lkmlabelt@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 25, 2020 at 11:37:20AM -0400, Andres Beltran wrote: > From: Andres Beltran (Microsoft) > > 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. > Per my understanding, this new data structure is per-channel, so it won't introduce contention on the lock in multi-queue scenario. Have you done any testing to confirm there is no severe performance regression? Wei. > Thanks. > Andres Beltran > > Cc: linux-scsi@vger.kernel.org > Cc: netdev@vger.kernel.org > Cc: "James E.J. Bottomley" > Cc: "Martin K. Petersen" > Cc: "David S. Miller" > Cc: Jakub Kicinski > > 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 | 150 ++++++++++++++++++++++++++++++ > drivers/net/hyperv/hyperv_net.h | 10 ++ > drivers/net/hyperv/netvsc.c | 56 +++++++++-- > drivers/net/hyperv/rndis_filter.c | 1 + > drivers/scsi/storvsc_drv.c | 62 ++++++++++-- > include/linux/hyperv.h | 22 +++++ > 6 files changed, 283 insertions(+), 18 deletions(-) > > -- > 2.25.1 >