Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2016439rdb; Tue, 20 Feb 2024 14:31:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUdHcI5Y7KrAHa/PdWYUraGs/kiZC6u5jqmoUVKxLy10e5XCWn4MdcGGPYMIcMgGKQdpvFTKWvGQDz6yLVbpVuENd6G9vAD2ExMzhihqw== X-Google-Smtp-Source: AGHT+IFURA3MDJY1t72wxudsAJI8NvVSam2O0x23RktaBbvzdRMnfXpbrZcoIqWNM8usYRWXZOXe X-Received: by 2002:a05:6402:646:b0:560:1652:e7cb with SMTP id u6-20020a056402064600b005601652e7cbmr11707472edx.16.1708468298316; Tue, 20 Feb 2024 14:31:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708468298; cv=pass; d=google.com; s=arc-20160816; b=KMBT6pm2kUniG5/bJ3Ma+XRg2fJM7vOCCiWl+7+g+ARV3XhANsx0rHKg3JNhAoWPMJ EbgH2qPwgIH6J5YQCYgwuhVqKuZ4SM4HMJpWIF2d0m/bOZvgcMfDB4jQBGwAs4dU3JJ7 8FV2/+r8CJxlH1AzEj6duUMXOTVIJ4FCCkdRut9lft3dZD4m/4yCzllzqgDRiO0QpzqX hycxa9QhYFwUPQ+HPeJtAs+e4Ztn3jVZjXiKjkz3xPC98thDfWEAUGklK4uHu2GsBGJj kHXApql89Ujkktyx49hXDLSk/XvYpcfrzqEWTUx7jM2H2yUXov4vGdwMxiati24mNM8a AaOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=dv8TZQpr3wTNyBqfx8MY6poN2sxcp5g64MzB25M03wo=; fh=0yDi9d/Tl/HudAM7msIwuZB0JQM0qsdEANI99mIwHo4=; b=m8eqeIiOrThFrhoomhGQDPC2F7nf65yseDDp/REvgARZnJOq5Kj9u0a+gXHfMAoG40 5GiPK7BxAtnHj87Jkg8yFKHg2MFCZjw6kuoAh7F2T0Rv1RiOLq9uHB3hIDDgiAuvDQ4L 1vUVN2oItpDITRz3JCBz5d6YTghLSkagvfN2jqHUHaiCWgVgaldwVkxc0/wk479f+VjU vgipvOBaLcn1ahP1bmANs2OM6Uv1QLAHg3oebtsT1lIYy5ja/G2h483s8OpoN5ioKAMe dsHxsC3px8Tb2bvDsd0X2YIxLZ8pa6tr9TdAjverW/hxfdsVKO/bVMMk1yjvJgh8+35Z 5spw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k9eD54gk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-73764-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t28-20020a50ab5c000000b005641e4fc486si3525218edc.121.2024.02.20.14.31.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 14:31:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73764-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k9eD54gk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-73764-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 111A11F223CF for ; Tue, 20 Feb 2024 22:31:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70C49153BE8; Tue, 20 Feb 2024 22:31:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k9eD54gk" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 915E255787; Tue, 20 Feb 2024 22:31:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708468288; cv=none; b=O6qL/zvXHgZwIXjfomH4eMQwl179WQOTyJkCdMqhtceOr0d7zH1RkFKo5Cq5qVe3aY4QNRjsfsmZDBy6b7LoAgmGs/zqEtRvJCj9NCLTthBwVpQy9kgYm5WwndyOHW9j9UTwLoVKXSCJA9f0mtCr+i8yAm+5bOeAYq7wX4z7gzE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708468288; c=relaxed/simple; bh=w945/N5R/OZj4+mcozJCxYwDnDG838MQGaRoMaxpMuM=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=tCs4RHd5/9doYr4vnYBIN0ewR1n6T/hGQXZK3xnJxZPMrwgPrf8ePmopOUrjMm/iJMXoygOW4iq3BpFra8zBiI7NozUXvMMo06TBDw4Y+xaHcmCpCVwdk2wKM8IYvwh2ypXEYR1/CI3HeDYa6zlT9AZ0AsIK7BI6dw9cvr5xVnE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k9eD54gk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A41EC433F1; Tue, 20 Feb 2024 22:31:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708468288; bh=w945/N5R/OZj4+mcozJCxYwDnDG838MQGaRoMaxpMuM=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=k9eD54gkimidEdoj4SAOqqp1mTghcxNAq04TIp2spSY/8HZ/ZSakg9+4b4WTCVzwd bX45wq+fdMZ6HvrwfwwQJsNjAsySJxQlYldE0jl2cVOqcBubXiHK819w+O+Uq5Fmkt keiOlWObKjiqABnBUiiOK1FZZMcXXnMKioMppinn36NC4QjIigvp/yIXXjIpu5WhZe mLYTp+c8ZWYj2n6E/p85lyPBdFJBBTW+FWXPe/WlNc3A4GaMQ+TCikScibqUcLCJmz F17bIMmqmAgEUtpSBt7QWjyFNkxyDg66lmeeIw/9CIi23NAmIf3Ig+bcfoMib2wjKx fzEQUrz1TA5EQ== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 20 Feb 2024 22:31:23 +0000 Message-Id: Cc: "Ross Philipson" , "Kanth Ghatraju" , "Peter Huewe" Subject: Re: [PATCH 1/3] tpm: protect against locality counter underflow From: "Jarkko Sakkinen" To: "Jarkko Sakkinen" , "Lino Sanfilippo" , "Alexander Steffen" , "Daniel P. Smith" , "Jason Gunthorpe" , "Sasha Levin" , , X-Mailer: aerc 0.15.2 References: <20240131170824.6183-1-dpsmith@apertussolutions.com> <20240131170824.6183-2-dpsmith@apertussolutions.com> <2ba9a96e-f93b-48e2-9ca0-48318af7f9b1@kunbus.com> <91f600ef-867b-4523-89be-1c0ba34f8a4c@kunbus.com> In-Reply-To: On Tue Feb 20, 2024 at 10:26 PM UTC, Jarkko Sakkinen wrote: > On Tue Feb 20, 2024 at 8:54 PM UTC, Lino Sanfilippo wrote: > > for (i =3D 0; i <=3D MAX_LOCALITY; i++) > > __tpm_tis_relinquish_locality(priv, i); > > I'm pretty unfamiliar with Intel TXT so asking a dummy question: > if Intel TXT uses locality 2 I suppose we should not try to > relinquish it, or? > > AFAIK, we don't have a symbol called MAX_LOCALITY. OK it was called TPM_MAX_LOCALITY :-) I had the patch set applied in one branch but looked up with wrong symbol name. So I reformalize my question to two parts: 1. Why does TXT leave locality 2 open in the first place? I did not see explanation. Isn't this a bug in TXT? 2. Because localities are not too useful these days given TPM2's policy mechanism I cannot recall out of top of my head can you have two localities open at same time. So what kind of conflict happens when you try to open locality 0 and have locality 2 open? BR, Jarkko