From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EB50C433DB for ; Wed, 13 Jan 2021 21:05:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63B942313E for ; Wed, 13 Jan 2021 21:05:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728928AbhAMVDu (ORCPT ); Wed, 13 Jan 2021 16:03:50 -0500 Received: from bedivere.hansenpartnership.com ([96.44.175.130]:42726 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728932AbhAMVCO (ORCPT ); Wed, 13 Jan 2021 16:02:14 -0500 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id D0F711280937; Wed, 13 Jan 2021 13:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1610571757; bh=fE4Zcfq/Y4akqpkapJYGe64eKFJFZOMq55tpgFz7vVs=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=dl4yC8ZtzcsUIGnJEZLCCSO6SL4K+hUbygwLH50SE/qHCnZUBXjYJbiVY1M9dcPXl /kIL3wmstaREA7lwPLYkf8iOA3cDxIwsATy8uCbu42ScydQItnxfc8xk7ME/xytV+E 2ku1pYYnoS9EIreFKn+V/0rw7w07p/Fz78clOybk= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nxOEhDK8RJzd; Wed, 13 Jan 2021 13:02:37 -0800 (PST) Received: from jarvis.int.hansenpartnership.com (c-73-35-198-56.hsd1.wa.comcast.net [73.35.198.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 6C1111280935; Wed, 13 Jan 2021 13:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1610571757; bh=fE4Zcfq/Y4akqpkapJYGe64eKFJFZOMq55tpgFz7vVs=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=dl4yC8ZtzcsUIGnJEZLCCSO6SL4K+hUbygwLH50SE/qHCnZUBXjYJbiVY1M9dcPXl /kIL3wmstaREA7lwPLYkf8iOA3cDxIwsATy8uCbu42ScydQItnxfc8xk7ME/xytV+E 2ku1pYYnoS9EIreFKn+V/0rw7w07p/Fz78clOybk= Message-ID: Subject: Re: [PATCH v5 0/1] add sysfs exports for TPM 2 PCR registers From: James Bottomley To: Jarkko Sakkinen Cc: linux-integrity@vger.kernel.org, Mimi Zohar , linux-api@vger.kernel.org Date: Wed, 13 Jan 2021 13:02:36 -0800 In-Reply-To: References: <20210113015958.6685-1-James.Bottomley@HansenPartnership.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Wed, 2021-01-13 at 22:48 +0200, Jarkko Sakkinen wrote: > On Tue, Jan 12, 2021 at 05:59:57PM -0800, James Bottomley wrote: > > This represents v5 which has the spelling mistake fixed and the > > WARN > > on unrecognized TPM hash algorithm becoming a dev_err. > > > > We've had a fairly extensive discussion and iterated to agreement > > on > > the output format, which becomes our ABI being one single compact > > hex > > representation of the hash value per file according to sysfs rules, > > with the file hierarchy going under > > > > /sys/class/tpm/tmp/pcr-/ > > > > So to get the value of PCR 7 in the sha256 bank of the default TPM > > I'd do > > > > cat /sys/class/tpm/tpm0/pcr-sha256/7 > > 2ED93F199692DC6788EFA6A1FE74514AB9760B2A6CEEAEF6C808C13E4ABB0D42 > > > > If you need the binary hash of a set of PCRs, as is required for > > TPM > > policy statements that lock to PCRs, you'd use something like: > > > > cat /sys/class/tpm/tpm0/pcr-sha256/{1,6,7}|xxd -r -p|sha256sum > > > > Which produces the binary hash of PCRs 1, 6 and 7 in that order. > > > > Note that this patch also adds the sha1 bank for TPM 1.2 in the > > same > > manner (one file per PCR) but does not remove the existing pcrs > > file > > which has the space separated all PCRs in one file format of > > > > PCR-00: 7D 29 CB 08 0C 0F C4 16 7A 0E 9A F7 C6 D3 97 CD C1 21 A7 > > 69 > > PCR-01: 9C B6 79 4C E4 4B 62 97 4C AB 55 13 1A 2F 7E AE 09 B3 30 > > BE > > ... > > > > > > James > > > > --- > > > > James Bottomley (1): > > tpm: add sysfs exports for all banks of PCR registers > > > > drivers/char/tpm/tpm-sysfs.c | 179 > > +++++++++++++++++++++++++++++++++++ > > include/linux/tpm.h | 9 +- > > 2 files changed, 187 insertions(+), 1 deletion(-) > > > > -- > > 2.26.2 > > > > After clearing out Greg's remarks, can you use jarkko@kernel.org > for the next version? Sorry, it's a force of habit process: i go back to version n-1 and copy the to and cc list ... so the promise to sent to kernel.org didn't get realised. I'll just do a resend since there are no changes requested. James