Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2324480lqb; Mon, 27 May 2024 16:18:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXE2NZ9k7MBl1cUBMrXtrl0yulvrnxq7tp6A5myKll04slZAvqrkrUkEwyDoSpxrgEIZM81ApfouSWyQAXTPgWMt6dR/MhC68jVgfLQzg== X-Google-Smtp-Source: AGHT+IGfBQQDw2Cg3pydHwx/s9BxRhQfpwN11H3B4n6RRF3B5gCNHDLNlorJRvSWE+9IqPQzc1oh X-Received: by 2002:a25:c749:0:b0:de4:5d4a:aa93 with SMTP id 3f1490d57ef6-df772167d4fmr10257525276.23.1716851884503; Mon, 27 May 2024 16:18:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716851884; cv=pass; d=google.com; s=arc-20160816; b=Y9prBOh7MlBwEG65eGcNvRY94UDYeIYSmNcqd2ZNsv9vB4/GzQM946iP8bEvd8gAXy JAp4YtO21ASJ/b+6oeP+9zbUYm4Kn5Bdt6TYCbI8OHdRc9UMRBfwcR7VASLf30a95wY+ 3bkm2VDTKesJi+yglAhJPityuMmmx/RQBOBuYy8XCNsjoc793uOOFpYyCp4Jw/XekGQX 3z2q4jzfU9Qj8MGm5whDxv/MnBMki8Gb/m5NuITbo9XdT3KuYlxlcXd/zfyDKTEvzIYy pceTxzSkZN8MRhqPkSs+1/0i4vly9iivZxJzMq2p604qlSeFShp6mv+oOpEOFLbskGS+ Fm6A== 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=R5IchMI+mhMNQTneBKtnFiTJTEpaIVLStStVGWdqlSA=; fh=+0MIkfyLH9VsjV6wJ6SrqpABvaisCEVqiihk8QJqKVw=; b=zH9cc1aWxKGjE74MlgZwMPUv9RFOvrj0a12FkDCJtbIOFdyWeCLr4drXpyW6EXyBZI g3ZnzNts2+OOR2HKU4/LRWQf/cJ0tSZMIdJRWbuaNXqLgoBlZgbgc2S6iEqh13Z9cVZ8 Gu+8T0sxAV0P+SWzTldW6YaDmomKNaxZWmdms9XsUWxHue4opD7cxP9EwlObeKs6RycF nBV2DOHoJid27WrSGtCPzH5tdj9VQHG5FQkB3qeA0h16ytiZlVF45TnOegnGmx7o/z5p cxe9he2VCuTPXTrvvKdThsvbdcfKDGVJydRBpYltOTWzi4JMl2hEbgdDEb6/H8zyG+7r TmKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JoYCtjY2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-191508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191508-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ad7748b15csi52108106d6.502.2024.05.27.16.18.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 16:18:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JoYCtjY2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-191508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191508-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2E1081C21401 for ; Mon, 27 May 2024 23:18:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82D65167294; Mon, 27 May 2024 23:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JoYCtjY2" 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 980CF167260; Mon, 27 May 2024 23:17:56 +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=1716851876; cv=none; b=r03mhi1YYkAgi8N9jHloEEPsbN57PLPy6YyGJdSooNOVGkQXOdZ/yHsHxN3nsPyLyMVh5kI/7Ngotas404/DwgFizfOnSSPTi4aaNIy9ZEaZjCVlYN3AXRct2mLHAtb4wSGhTVfpAw98GXnALuf5xuwHRDsu/gwIykx9dSVS+Wc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716851876; c=relaxed/simple; bh=jb/imuwe69NBobGpoWK99Ey/b4hHD1hQVzngwPMBUIc=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=N7KsVGaGb9tLHhqIHCrR8xUGp7AENfspcC/8DMiCeSvxrrcgvh+7MYaJuyiZ9b2rjMGPEN0tUlsIaC268GwavrxzJbTPkYWsQdnVIPH4SPmUGm0sU9Rjk3SUsbAXq66DfCC2+egF+/XhtQQUq7qlFAcpMv6utlqsr3U2V8EEmz4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JoYCtjY2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C8A7C2BBFC; Mon, 27 May 2024 23:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716851876; bh=jb/imuwe69NBobGpoWK99Ey/b4hHD1hQVzngwPMBUIc=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=JoYCtjY2R1SmQrWqUtAbU2ssn7U2SSRA47yxeSvtHCa2T8pWlp+ygcpXc0pyX/dBP IYF1azGIdPvN/vFcSsGH890hBHlBBuwvY0OFTjU50vzxYRMJ9Kyn3TJLe8c+w4tTTQ a+FqTc89XqGTNujet+2rVUXCCFf60zyLAIDNdE6Lg0za7o8DDAXJ20hreM+8fA3VG/ LhSF3C3nnIvQdLlBOdAI/wc/EVkiEWeyVQA5e7Eajx6pfYYiSyvMNDWhrjHb4WzRyc xS4EfyTzMoct1ttC2RjTDgAuXpu5JSELYWHMJlRgt8SV18fVCPc8b1PbyPuE20wklS PFUEMc3TQz7sg== 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, 28 May 2024 02:17:51 +0300 Message-Id: Cc: , "Peter Huewe" , "Jason Gunthorpe" , "Mimi Zohar" , "David Howells" , "Paul Moore" , "James Morris" , "Serge E. Hallyn" , , Subject: Re: [PATCH 1/3] tpm: Disable TCG_TPM2_HMAC by default From: "Jarkko Sakkinen" To: "James Bottomley" , "Vitor Soares" , X-Mailer: aerc 0.17.0 References: <20240519235122.3380-1-jarkko@kernel.org> <20240519235122.3380-2-jarkko@kernel.org> <850862655008f84ef0b6ecd99750e8dc395304d1.camel@gmail.com> <17dc838120b56ce342c34611596c7b46dcd9ab5a.camel@HansenPartnership.com> <2dd8d49516ec9c7cb8c1182b5b8537b1e82d7067.camel@gmail.com> <17a5dcd7aceb356587ef7c8f45b0f6359b2d2a91.camel@HansenPartnership.com> <0c12c9ea10aa97e246230fc33e6b35c571102b48.camel@gmail.com> <3e4bbd0f0fe9f57fd7555a3775e8d71031c0d6c5.camel@gmail.com> <6e326fa73968839199378694d4e7cc2544326fa6.camel@HansenPartnership.com> In-Reply-To: <6e326fa73968839199378694d4e7cc2544326fa6.camel@HansenPartnership.com> On Tue May 28, 2024 at 12:36 AM EEST, James Bottomley wrote: > On Mon, 2024-05-27 at 22:53 +0300, Jarkko Sakkinen wrote: > > On Mon May 27, 2024 at 8:57 PM EEST, James Bottomley wrote: > > > On Mon, 2024-05-27 at 18:34 +0300, Jarkko Sakkinen wrote: > [...] > > > > While looking at code I started to wanted what was the reasoning > > > > for adding *undocumented* "TPM2_OA_TMPL" in include/linux/tpm.h. > > > > It should really be in tpm2-sessions.c and named something like > > > > TPM2_NULL_KEY_OA or similar. > > >=20 > > > Well, because you asked for it. I originally had all the flags > > > spelled out and I'm not a fan of this obscurity, but you have to do > > > stuff like this to get patches accepted: > > >=20 > > > https://lore.kernel.org/linux-integrity/CZCKTWU6ZCC9.2UTEQPEVICYHL@su= ppilovahvero/ > >=20 > > I still think the constant does make sense. > > I'm not so sure. The TCG simply defines it as a collection of flags > and every TPM tool set I've seen simply uses a list of flags as well.=20 > The original design was that the template would be in this one place > and everything else would call into it. I think the reason all > template construction looks similar is for ease of auditing (it's easy > to get things, particularly the flags, wrong). > > If it only has one use case, it should be spelled out but if someone > else would use it then it should be in the tpm.h shared header. It is used only in tpm2-sessions.c and for the null key so there it should be. And it is also lacking the associated documentation. Now both name and context it is used is lost. BR, Jarkko