Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1554238ybt; Thu, 25 Jun 2020 08:38:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJH89PDWux2tPwo9e9i3UE7FWZscl9+1on2f0TwxcHksNJqiMqfdQzHvXaWt+/MbI0tClA X-Received: by 2002:aa7:c31a:: with SMTP id l26mr7329471edq.61.1593099502265; Thu, 25 Jun 2020 08:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593099502; cv=none; d=google.com; s=arc-20160816; b=duhA0GBhDM2pv/QGr/uqquydlzE6r0KmQX0p7SDePpdB8OSjereTJdo5zejEj1c3yu +O+Rk20i12KBqaV0tFlWMG3JiPLxHpYcaic4CotaxQt+3uTeYzNvxr6L2CKLSfBRTFte WkXLIr1SbHIsVk37Bfe4ArlyzJI/zOjfjy5PbO7UmSRrRMPEFmnFfBe9G40TshP5E1pp 0LWXbZp7Q4wWpJd8KegOtHBzBP2v5Z678XA4ptpr/znk2EazLIysJ3w+Z0h9bBkbs0Vz jjVUR3kWRue7a8xi7eZoiJfui0SOLOxvXUhES1EAkSdwm2hnx2XGz7i3aXEroLMLeWy7 Yw1Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=eKf/0lxOewQJNcyUw6TguSyEm4wSYJQCqTzuEz6QHDI=; b=hS1FCcdhCIMMBJUo//DJYzOQMHphMRJ7DN/QU8hCsN5TueyjsZyNcGfhIvuTrLfG9k I7/UTTztNH8Q1WrTgRzHUn59K2jxIO+uXqrz/fXe2wnRtouQ/8Kiv69bgdUXY4CHhRTt TGTXq1EF260P1MLiCWWS0Eef2NHimn6Wr5PXwmXzEgscwAAOZI0EsExk/wQmMYiHrE3D mECYHQ+HtfgNBsuaK6+foFB5vdl9o983LJzECZKM3xtxpy4Wlz5VhU1XugKbQJCUf7LS pKHyXhBItPSHHto32rCvC+TKpVZ1Hugndnut/oskXX51BvX2tdy0ghfO+1ZLxlzago7L 04JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ilwQ2Uul; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si14798173ejb.751.2020.06.25.08.37.58; Thu, 25 Jun 2020 08:38:22 -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=@gmail.com header.s=20161025 header.b=ilwQ2Uul; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405887AbgFYPhi (ORCPT + 99 others); Thu, 25 Jun 2020 11:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405159AbgFYPhh (ORCPT ); Thu, 25 Jun 2020 11:37:37 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95B82C08C5C1; Thu, 25 Jun 2020 08:37:37 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id d194so89642pga.13; Thu, 25 Jun 2020 08:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eKf/0lxOewQJNcyUw6TguSyEm4wSYJQCqTzuEz6QHDI=; b=ilwQ2Uulb1xjp/tK5MQHOUK+bIid5rWWRdDzOZGrO/2KJcOjgX91/pFrJJYpVv08cM WNJbLqJrt7jhsY4dI6GH9OljGn1WGkRkNiKQQ2vcojTPrjAq4YkQ/mg+nB6nNQR8eQ6S 8uzbs9doCD3F7on4ZZEJ+tMl0c0Ylrx5mLbb5Zjwpj1i/CrpA9BfCH2496q72RSj/y6R 3caexTQppWUu0kQRhnc7UH+KSQlpRGiaOFHM8A5ATNy0WVpP2DrfE5kxv+jiMDCKn7/C xHhtiGg1VfxDiKzd1QsW+606pyH3sgyyUgmiRI1F0oJQi1EcQLdQLC+C9l0UVfoCc5di SkQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eKf/0lxOewQJNcyUw6TguSyEm4wSYJQCqTzuEz6QHDI=; b=m5UAAhfIhwPVEK2rcw1lThW4MgFUgd6tJV1uftBrgugtfsrD8oIMCyfIanFuOE4gQX QZzEc1z4JRYSulILM5Ef45tI54j+Mz3OhqhJwpsjonZkByz2WIGBE5PYAHYyFOL+kXRB qfQX9CNAQTLzzbX5yKs4XLhVctGGudU6edJpX+h1YFge21yIOKx13Jqa6j/haGj4YtW6 kh0hnQPdiNLYahkF5wOhYDjpYkwxv7j8Pz66VByXM3yqEDDTFZ8Zqkf48Gh7lpZ00T8G xgAqaZ5oCO4HRPdw6HSa2h5vnlgG2QC+Qhg8vdZFBNvZEOQrEXy7DuB74M7K8BWfdL6S u/FQ== X-Gm-Message-State: AOAM5334FMKXRc/1OnIdXmKaevlozldSGFNT3DIPPX+DzdYEqP3gX5c7 LmgFskTYEx32DwyfB+qL+yA= X-Received: by 2002:a62:8683:: with SMTP id x125mr35592234pfd.211.1593099457135; Thu, 25 Jun 2020 08:37:37 -0700 (PDT) Received: from localhost.localdomain ([131.107.147.194]) by smtp.gmail.com with ESMTPSA id i14sm22980813pfo.14.2020.06.25.08.37.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 08:37:36 -0700 (PDT) From: Andres Beltran To: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, mikelley@microsoft.com, parri.andrea@gmail.com, Andres Beltran , linux-scsi@vger.kernel.org, netdev@vger.kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" , "David S. Miller" , Jakub Kicinski Subject: [PATCH 0/3] Drivers: hv: vmbus: vmbus_requestor data structure Date: Thu, 25 Jun 2020 11:37:20 -0400 Message-Id: <20200625153723.8428-1-lkmlabelt@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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