Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp543031rdb; Thu, 5 Oct 2023 13:34:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRyX9h1um+Muk4zRa+z/90I6+h553wudT7eGIDdfPhG1vQUM4mKqBSMZSh3NI9TdMhG/Yc X-Received: by 2002:a05:6a20:564d:b0:160:97a3:cae7 with SMTP id is13-20020a056a20564d00b0016097a3cae7mr5379767pzc.57.1696538092356; Thu, 05 Oct 2023 13:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696538092; cv=none; d=google.com; s=arc-20160816; b=mZLmy2YluGgcj4IqcnV7NB58Hy1ZvxdmI5bcRn3xlTvG5IQA9KiNvv7K7KBAznY8cU 7yOcw3+NAcMxq1lDUe5tFqxVj7k6x/cIGsguTDicFLQO0TbiG+4F1RVz7yghDVWuRpPo CqDFHb5hbhhXvQtLqK1wNzbuNBf7MhnYODork9pubi+0P0zp+kES6ZQfwAZv0jU7y9kg H0wY7w/GtVrGwqwrwFSBDKrgcs+aLR6I+7wmqsQ6RiCKw75zYGWij9GNHFGcLPsbtXeE 9J/H1jwPCKDPoO8YB2r3ogIgYmb9cGO0tEkpp3G3MEkK+KvHuRNRb1CyBtTz6ElryvVs cvyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=xWB8nomFvrNs8TXnd2W2ExqIcttxQa6NF2AkUoGt2a8=; fh=UqJnIK0ir3eUtKGQENTcXPJAhZG9fejslxX9ap4c2W0=; b=ne85TjUK9kgc0CoGuxtErYdl/dg4GQ0S6SsRjpNW29Ti2aleSL3YmIrXXqGWgdOaej 94oJE4ugz9Ys6udOWMVS8a8Q8FibvvqGGdNs4keDqsewayuP42LiHTu/W1lZ4Mj4Nhg1 OBD+BoDFMih8XT+MuWfRCSulaBa3xpdqYkcha1aLzxCgbUo8t+3BG/+TY2O3OJRJoJeV TgkahQzDOV2FDZT/V+OF5+kBk4AdWHzEvzdteCZGw7H08LCMzT1nLRBXaXuuouv2nGpz sgbWrrji2EMX2Ok5dqrtBQ5kHaMPQsTCyTQMweEyEBzPbmInejcffrBX3WTGMXkI7j03 4ZXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YxLYOc8G; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id y124-20020a636482000000b005774aba519dsi2095478pgb.298.2023.10.05.13.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 13:34:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YxLYOc8G; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A044A8077906; Thu, 5 Oct 2023 13:34:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229542AbjJEUeq (ORCPT + 99 others); Thu, 5 Oct 2023 16:34:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjJEUep (ORCPT ); Thu, 5 Oct 2023 16:34:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA48793; Thu, 5 Oct 2023 13:34:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2C61C433C8; Thu, 5 Oct 2023 20:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696538084; bh=32IWGcl/GhLZ3tegbGVzkBqng/XbsFXjV2W9sDN1IaY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=YxLYOc8GFP90I4Qy7piJ2uW3Mydkjmt+GKzOfIJP1dMkj9hSr6to2W9muxd7RukI/ wdHdVqAG61HQqdffBx/9Oz3g4NJDpzaLH63to74WjxZLPEOfo5HrLH3nYB2DviFL49 n7JcH3a9NerZVzzBZCNX2LtR/kMHhAzwXqwcmw3QFC39pNzy07rp7NlhuwT9cUQ0iZ U1UhM3GGv+Oh1hCmfMrIDCK3dvC4nEz3iT5cxpulGSRle9wzR0q/yTMnSQUWi8LQLS YYLQe2P3wp5k482GvCK6BW7PqkWC5nMaBdMVm9EVXC9PGyD+IRRpTiSiWVUlaQKQjZ XEy4QwveN7JyQ== Date: Thu, 5 Oct 2023 15:34:42 -0500 From: Bjorn Helgaas To: Lukas Wunner Cc: Jonathan Cameron , David Howells , David Woodhouse , Herbert Xu , "David S. Miller" , Alex Williamson , linux-pci@vger.kernel.org, linux-cxl@vger.kernel.org, linux-coco@lists.linux.dev, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, kvm@vger.kernel.org, linuxarm@huawei.com, David Box , Dan Williams , Dave Jiang , "Li, Ming" , Zhi Wang , Alistair Francis , Wilfred Mallawa , Alexey Kardashevskiy , Tom Lendacky , Sean Christopherson , Alexander Graf Subject: Re: [PATCH 12/12] PCI/CMA: Grant guests exclusive control of authentication Message-ID: <20231005203442.GA790578@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003193058.GA16417@wunner.de> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 05 Oct 2023 13:34:48 -0700 (PDT) On Tue, Oct 03, 2023 at 09:30:58PM +0200, Lukas Wunner wrote: > On Tue, Oct 03, 2023 at 04:40:48PM +0100, Jonathan Cameron wrote: > > On Thu, 28 Sep 2023 19:32:42 +0200 Lukas Wunner wrote: > > > At any given time, only a single entity in a physical system may have > > > an SPDM connection to a device. That's because the GET_VERSION request > > > (which begins an authentication sequence) resets "the connection and all > > > context associated with that connection" (SPDM 1.3.0 margin no 158). > > > > > > Thus, when a device is passed through to a guest and the guest has > > > authenticated it, a subsequent authentication by the host would reset > > > the device's CMA-SPDM session behind the guest's back. > > > > > > Prevent by letting the guest claim exclusive CMA ownership of the device > > > during passthrough. Refuse CMA reauthentication on the host as long. > > > After passthrough has concluded, reauthenticate the device on the host. > Could you (as an English native speaker) comment on the clarity of the > two sentences "Prevent ... as long." above, as Ilpo objected to them? > > The antecedent of "Prevent" is the undesirable behaviour in the preceding > sentence (host resets guest's SPDM connection). I think this means "prevent a reauthentication by the host behind the guest's back" (which seems to match the first diff hunk), but I agree it would be helpful to make the connection clearer, e.g., When passing a device through to a guest, mark it as "CMA owned exclusively by the guest" for the duration of the passthrough to prevent the host from reauthenticating and resetting the device's CMA-SPDM session. > The antecedent of "as long" is "during passthrough" in the preceding > sentence. "as long" definitely needs something to connect it with the passthrough. Bjorn