From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754593AbcGTRmd (ORCPT ); Wed, 20 Jul 2016 13:42:33 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:33390 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753619AbcGTRmZ (ORCPT ); Wed, 20 Jul 2016 13:42:25 -0400 Date: Wed, 20 Jul 2016 10:41:25 -0700 From: Andrey Pronin To: Jason Gunthorpe Cc: Jarkko Sakkinen , Peter Huewe , Marcel Selhorst , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Christophe Ricard , smbarber@chromium.org, dianders@chromium.org, groeck@chromium.org Subject: Re: [PATCH v2] tpm: add sysfs attributes for tpm2 Message-ID: <20160720174125.GA45696@apronin> References: <1468547496-16215-1-git-send-email-apronin@chromium.org> <20160720170553.GD21460@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160720170553.GD21460@obsidianresearch.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 20, 2016 at 11:05:53AM -0600, Jason Gunthorpe wrote: > On Tue, Jul 19, 2016 at 07:51:52PM -0700, Andrey Pronin wrote: > > Add sysfs attributes in TPM2.0 case for: > > - TPM_PT_PERMANENT flags > > - TPM_PT_STARTUP_CLEAR flags > > - lockout-related properties > > I'm not completely sure we need to have these sysfs attributes. Do you > have a reason to expose them? Does udev do something based on them? Is > it just for debugging? > > Otherwise it looks about right to me. > In practice, useful for scripts that monitor in what state the system started, was there a lockout, can we use tpm for attestation, can we rely on data stored in NVRAM, etc. And then interact with the user accordingly. I don't know of udev rules that do anything based on them, but in a multi-tpm system, I can envision one that selects the tpm that was actually used by firmware as the primary one, or controls permissions for the device based on the state it's in. For TPM1.2 we expose some flags from TPM_PERMANENT_FLAGS and TPM_CAP_PROP_OWNER, for example, to show if the tpm is owned, enabled etc. A combination of ph/eh/shEnable and *AuthSet flags from TPM2 provides info allowing to make similar decisions about the tpm being 'owned' or 'enabled' for userland scripts. Andrey