Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp713624ybh; Wed, 22 Jul 2020 11:13:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDGI9Xa2O/1Q9Nk/WaUGAlRW9KWWOmmvs1iEGZYQJ8v/fg534r65K/pRgAj2QXp4pb4ThX X-Received: by 2002:a17:907:385:: with SMTP id ss5mr68360ejb.496.1595441620350; Wed, 22 Jul 2020 11:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595441620; cv=none; d=google.com; s=arc-20160816; b=o01l/MGx4paK9hd/nh3GfgiRFazCEy8pr03tY7YgBPY5wyBSW2bB2gFDj0UY1jSoxc 7+OWzFshTynjRev/Aq38WpYG07jeK1FwOiIJM1NzJKtVaHpApa90lvHWGoGVq+Fjjlwu 8YvoaFU7fLCD89S7UsDOHETczxO7SdJN2a7jJT2IQqYgcnX4IWLE6BucGclsjILPe6D6 6JzINV2PcZCJ9orNjKtbf+VzZVrGtGqMQ4atcgUWV1YGNCU/duG0L2HwCy4JKvyN4bcR REaBIx3m5Mx1AT9UJNoMKLKtBwnslKhUtcPm7CYjFnbEYxaVIbpdScGmWpOigR74YOc0 y0ag== 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:reply-to :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=4bTtBQ7yXHkaoasiaxmFnO7oa9s0p9Y0Xwq4E/P0kGQ=; b=S2NLKptdaBS/b4Ko2r0spcwvy4PG/t7AM7sWvGuv36UrlXI+7kivc+MfZSKAYM5xWD Rl2e3iyvMD7Rw838KnhALf13Krj2zdBTwPEVreyJdDCVtx7G0T467ql0P5yCRjyejdo3 utA0Dmlr1Llw5jj2z80GIGLLHaQ9iQQzPCoFkJIx62pTZe6iB801hkPvvo5vkrxTMWI6 k/h8o0e6o5BpNkObZ4UmFnsFiEMBlbJTjYSQ2k3xf7gFe5gs6Ohs/NrGtgjNzsdBfflq Uii4FlYkyNTA/So1SfQyu8cYVK1fOqFOA65oVbCcTTDlwkKdJKKF9HVe/spUWOCGFE3e 4pKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=R6mvOm8H; 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 w23si508728eds.47.2020.07.22.11.13.17; Wed, 22 Jul 2020 11:13:40 -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=R6mvOm8H; 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 S1731370AbgGVSKz (ORCPT + 99 others); Wed, 22 Jul 2020 14:10:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbgGVSKy (ORCPT ); Wed, 22 Jul 2020 14:10:54 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9618DC0619DC; Wed, 22 Jul 2020 11:10:54 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id b92so1816427pjc.4; Wed, 22 Jul 2020 11:10:54 -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:reply-to :content-transfer-encoding; bh=4bTtBQ7yXHkaoasiaxmFnO7oa9s0p9Y0Xwq4E/P0kGQ=; b=R6mvOm8HOCRvymu5Gb+BUEPcZ4A0OUGmjvFmEE6RLUBks77EVtmhw4h0WgaICqgbg4 uZ40fdZXlhyGzDqlc+Z6kvfE8YSEQlX5jH9cJG58TUX9xUoGXtwqPnRx9skk0Vo3CmkW MdtWjXYUDRp6YggMY3iL96mEwcEaUrbMrTFK7SJnKy3IiVksPzj7XR1tmpcbSvjXEPaR nvcnGYc8jAwXx8pMHm9k3Ktyo2+fCw2o+QD6SqOnwSBf9GSLhomQ1kn3iF+JpZ1Kmu5b P8aNrL4jraDJUq+IP/9RY4hA+Bv7iJ8mi6XUe0goceM5BHwMp1ts54xpLtG4v4cr5lbU fc+w== 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 :reply-to:content-transfer-encoding; bh=4bTtBQ7yXHkaoasiaxmFnO7oa9s0p9Y0Xwq4E/P0kGQ=; b=QOGuPaXIRLssfy0hPh9sP1oZx+u+tEhO5BYcqF9MGh4GZsbKoEDSmPoZ2wsdDs+g0h /Iwz4b/pM5RyxsPnOPpLfG6Ylx+9nvOzWJe60W7hMk+IHmZqYuLiQFXs5cdRewrcu/NI dFvb5L+h7wDTNp7cg7JnRiQ7OeVvLrBbBjZgPqhtuBpDAfTdx3hGbGsPihfDE+v4Rm+3 I+XgOOMCkExVyRLLPtnJCIHEOVvMPeXI6mPNcmx6MaqPQWPwzh2VtEd3oe+Czu4h7f/c S8ceNumbGDAOF7WVSB5OAS/2FBPv90DGYPgBn1liXuYVUwelrSkmcd3aKEJlSjhm26A/ /d9A== X-Gm-Message-State: AOAM530LmskQpT/YsN6VZqfS4WS/n9TMM0T07enxQc+jpC4KY8R/rQWm aUTfFXJ0JMOZ/QqGFgYRoCw= X-Received: by 2002:a17:902:7807:: with SMTP id p7mr608618pll.242.1595441454186; Wed, 22 Jul 2020 11:10:54 -0700 (PDT) Received: from localhost.localdomain ([131.107.159.194]) by smtp.gmail.com with ESMTPSA id y80sm259958pfb.165.2020.07.22.11.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 11:10:53 -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 , "James E . J . Bottomley" , "Martin K . Petersen" , "David S . Miller" Subject: [PATCH v5 0/3] Drivers: hv: vmbus: vmbus_requestor data structure for VMBus hardening Date: Wed, 22 Jul 2020 14:10:48 -0400 Message-Id: <20200722181051.2688-1-lkmlabelt@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Reply-To: t-mabelt@microsoft.com Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.25.1