Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2333029lqb; Mon, 27 May 2024 16:44:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjrtlF9FF0qqtSPzWsLGCYJ9pkA9A8vHrPuMe+QAtmZIuKn0EhbQJ3BtBum7YOYe6AhrbV53i0+Yt6ILxzYD60awWBWPtbSQrQUUIa1g== X-Google-Smtp-Source: AGHT+IF1aWwvAvhfMn/NlNvwIY7sz1Ya8cw4DbSb1aQ1uknFKlkAEwzmCdEvjowqFpmZO8HNwlgr X-Received: by 2002:a05:6a00:28cd:b0:6ed:5f64:2ffa with SMTP id d2e1a72fcca58-6f8f194abd8mr16422084b3a.0.1716853491681; Mon, 27 May 2024 16:44:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716853491; cv=pass; d=google.com; s=arc-20160816; b=hP0hFU/VYlApAhrMzPyu29p8w/EyL4i+Ql08tiPUBa+hIsX1TXZ4EzguhpBcI9wJt6 hvQ5EsyZk2vDgnRdx0VqRRYCYHAJtrITh7K8RtKpNvylb5qUM6h5wRuguRL8hLB+quz5 GMVCFhUCeoO6yDaTY7wNQ0BVAjIwN8TrGGYyxllAugIw33TyscJICszoCmirer7XF4wh KqksusgNuBkcm83gGEGvuDEhqyRKDpKYwt2xob8Tt1YwjnY1ALgmr0Yl3wgVlIJ4ec1w Wt2oAT3oDm2XLU/0Mx3bzcmeZbtP48KQkoY2JVAU5f2IOnAqKchHBunU0XnOAZifT3Rz +OOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :date:cc:to:from:subject:message-id:dkim-signature:dkim-signature; bh=PXKlep3hZzi+8ekptOkYEyQYprOHKoJZeCN3U61n05c=; fh=PBJszKfOuF7bnu4KMjYiO7NcHK+w2SF3QXhw73B4aug=; b=b7m4+tfxwVCOJNBVJr80vvpDc24WK9YEat1fQal1eOUJAIRNA37CI1oj7Hvh5D5rXf xw0i+RFu+iZ4GC6hy5l2owFu00dM97L0MJ6Frq7zfBF+tYB9KSashEeedSzDPZUjRb3P nqVZJVn//zWmQuu+ndtdotXTZaj06wA27VpDZdZoXZPAV6jTB4kZ2O3LyTmRlP43Zfk/ wNCE6Sy3kNynC/GLR1eiD2PEx6JjpJA3zoAZIHKXA5KyK0lgcX0QQpc6iafYqeR+HWfy QiAza6JYORyxcaxuFlpf5xhP20Zqaj98l/q9fKiHGYQX5c6+F8ro0u1GenlsBEvngV90 iGfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=LfLWhYiZ; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=PsAJcFYL; arc=pass (i=1 spf=pass spfdomain=hansenpartnership.com dkim=pass dkdomain=hansenpartnership.com dkim=pass dkdomain=hansenpartnership.com dmarc=pass fromdomain=hansenpartnership.com); spf=pass (google.com: domain of linux-kernel+bounces-191516-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191516-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-68229a3061dsi7075038a12.661.2024.05.27.16.44.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 16:44:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191516-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=LfLWhYiZ; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=PsAJcFYL; arc=pass (i=1 spf=pass spfdomain=hansenpartnership.com dkim=pass dkdomain=hansenpartnership.com dkim=pass dkdomain=hansenpartnership.com dmarc=pass fromdomain=hansenpartnership.com); spf=pass (google.com: domain of linux-kernel+bounces-191516-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191516-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0B0702831D5 for ; Mon, 27 May 2024 23:44:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C1C9152E04; Mon, 27 May 2024 23:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b="LfLWhYiZ"; dkim=pass (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b="PsAJcFYL" Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com [96.44.175.130]) (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 DBDBB45C14; Mon, 27 May 2024 23:44:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.44.175.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716853483; cv=none; b=quslUQOja8EzGXdgd2l3g0eR9OyEPwkAi15YE7NsRkK7QC6nZPibSNJ7MPfH1+P/Vb29v0tuqcEhEBNkD6CMVEoa/Lq/DsAcCcKFMe2yKh237M6tiQSUEi9tVAz/M5XngryT2rGyKbq1wJqFXgytpAM3zoW9LZ8EVFS7EdHRWPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716853483; c=relaxed/simple; bh=EdBpJBA58UcDomxKHuYzuX9Ow/+7jqpFZIh974Rr9ZQ=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Gecd9PS9xp8UfYALVexZkMbnU1+mmsqdrYHVzD4xMZ2tip71S1nwC6iOI1gSJxpD5SE2D5NNY1OugZAz+as4elRVd67NHBr10XGQS0i1Hl34almrwdQKwaWkxuMrIC/6soV1izOBvW5MzLwDZaqlaglzOR6jE7nt6UHM2MYxpAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=HansenPartnership.com; spf=pass smtp.mailfrom=HansenPartnership.com; dkim=pass (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b=LfLWhYiZ; dkim=pass (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b=PsAJcFYL; arc=none smtp.client-ip=96.44.175.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=HansenPartnership.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=HansenPartnership.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1716853481; bh=EdBpJBA58UcDomxKHuYzuX9Ow/+7jqpFZIh974Rr9ZQ=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=LfLWhYiZXlMHZ/97dfDfPTo6UdmMq8D7jX7cZxYHuIQC35snsYIoSAyIW+Q8Ar6Y0 /oMDhlLJSlfnhgHNkRorcUfNsrwk5U4VFOCN4fxWdcvQbOkYh2zVI6jAomQalGJluV XCYD8NKEBCoGLUdh/0VuMkORCvcxN5TDoklhmnQs= Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 263001286C7A; Mon, 27 May 2024 19:44:41 -0400 (EDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavis, port 10024) with ESMTP id z9z6VeenUfAD; Mon, 27 May 2024 19:44:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1716853480; bh=EdBpJBA58UcDomxKHuYzuX9Ow/+7jqpFZIh974Rr9ZQ=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=PsAJcFYL58leUIBRjUDZOYXixrtVw6qx4tLzqK7De4ddlx+gfZr/MAE5rdH7rxvv+ D4VTWU+BRSZm034erdkHkdAGRhm81Omowp8zCgCI1NrlVErQbdxAjZ5akO4YIe0Pon vnQbK/zphsepj1tf73k3qm6xBG2bzh1xmS2/Z8lY= Received: from lingrow.int.hansenpartnership.com (unknown [IPv6:2601:5c4:4302:c21::a774]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id EA9B312869EC; Mon, 27 May 2024 19:44:39 -0400 (EDT) Message-ID: <439c3a66a995429f6c8603640477580e17d03104.camel@HansenPartnership.com> Subject: Re: [PATCH 1/3] tpm: Disable TCG_TPM2_HMAC by default From: James Bottomley To: Jarkko Sakkinen , Vitor Soares , linux-integrity@vger.kernel.org Cc: keyrings@vger.kernel.org, Peter Huewe , Jason Gunthorpe , Mimi Zohar , David Howells , Paul Moore , James Morris , "Serge E. Hallyn" , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Date: Mon, 27 May 2024 19:44:38 -0400 In-Reply-To: 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> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Tue, 2024-05-28 at 02:17 +0300, Jarkko Sakkinen wrote: > 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. > > > > > > > > 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: > > > > > > > > https://lore.kernel.org/linux-integrity/CZCKTWU6ZCC9.2UTEQPEVICYHL@suppilovahvero/ > > > > > > 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. 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. The comment above the whole thing says what it is and where it comes from: /* * create the template. Note: in order for userspace to * verify the security of the system, it will have to create * and certify this NULL primary, meaning all the template * parameters will have to be identical, so conform exactly to * the TCG TPM v2.0 Provisioning Guidance for the SRK ECC * key H template (H has zero size unique points) */ If we put the broken out flags back it's all fully documented. James