public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
	Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, Rajiv Andrade <mail@srajiv.net>,
	tpmdd-devel@lists.sourceforge.net,
	Richard Maciel Costa <richardm@br.ibm.com>,
	"trousers-tech@lists.sourceforge.net" 
	<trousers-tech@lists.sourceforge.net>,
	Sirrix AG <tpmdd@sirrix.com>
Subject: Re: [tpmdd-devel] [PATCH 09/13] tpm: Pull everything related to sysfs into tpm-sysfs.c
Date: Mon, 07 Oct 2013 11:06:26 -0400	[thread overview]
Message-ID: <5252CDF2.4090304@tycho.nsa.gov> (raw)
In-Reply-To: <524F1450.6060406@linux.vnet.ibm.com>

On 10/04/2013 03:17 PM, Stefan Berger wrote:
> On 10/04/2013 01:08 PM, Jason Gunthorpe wrote:
>> On Mon, Sep 30, 2013 at 05:09:51PM -0500, Joel Schopp wrote:
>>
>>>> So far, nobody I have talked to has offered any strong opinions on
>>>> what locality should be used or how it should be set. I think finding
>>>> a developer of trousers may be the most useful to talk about how the
>>>> ioctl portion of this would need to be set up - if someone is actually
>>>> needed.
>>> I am a TrouSerS developer and am ccing Richard, another TrouSerS
>>> developer, and ccing the trousers-tech list.  It would be good if you
>>> could elaborate on the question and context for those not following the
>>> entire thread, myself included.
>> Two questions:
>>
>> Is userspace interested in using the TPM Locality feature, and if so
>> is there any thoughts on what the interface should be?
>
> In terms of interface it should probably be an ioctl so that whoever
> holds the fd to /dev/tpm0 gets to choose the locality.
>
> Locality allows the resetting of certain PCRs. See section 3.7 in
>
> http://www.trustedcomputinggroup.org/files/static_page_files/8E45D739-1A4B-B294-D06274E7047730FD/TCG_PCClientTPMInterfaceSpecification_TIS__1-3_27_03212013.pdf
>
> Locality 4 can only be used by the hardware (section 2.2).
>
> Locality has an influence on the following TPM commands:
> TSC_ResetEstablishmentBit, Seal, Sealx, CreateWrapKey, UnSeal,
> GetPubKey, CMK_CreateKey, SHA1CompleteExtend, CertifyKey, Extend,
> PCR_Reset, NV_ReadValue, NV_WriteValue, and others.  Some of the
> commands allow operations to succeed if a previously selected locality
> is also currently the chosen one. (If you have control over choosing the
> locality, at least that part won't prevent you from succeeding..)
>
> http://www.trustedcomputinggroup.org/files/static_page_files/72C33D71-1A4B-B294-D02C7DF86630BE7C/TPM%20Main-Part%203%20Commands_v1.2_rev116_01032011.pdf
>
> The worst would probably be if an application was to reset a PCR while
> another one is using that PCR or just for malicious purposes. Not
> providing support for choosing locality would mean that applications
> could still use PCRs 16 and 23 for their own purposes and can compete
> for their exclusive usage while being able to reset only those two.

Any important measurements that would be impacted by a userspace-generated
reset should be directed to the non-resettable PCR 0-15 or 17-19 (allowing
DRTM to reset them). Ideally the /dev/tpm0 device would be opened only by
tcsd (which could be measured by IMA and enforced by an LSM), which could
implement its own restrictions on what clients can extend or reset PCRs.

> Are there use case for resetting PCRs from user space? If not I'd not
> support choice for locality from user space.
>
>       Stefan

It's not just resetting - extends to PCR 17-22 are also restricted based on
locality, so without this interface they have been read-only.

There are use cases that are significantly simplified by using multiple
resettable PCRs. One (slightly contrived) example: tcsd manages one PCR so
that it holds the hash of the executable making a local IPC request, another
holds the arguments or pathname, another the IMA signature key used to sign
the application. This allows the application (say, a keyring) to seal data
that only it can unseal; without multiple PCRs, a more complex interface
would be required to support a choice between sealing to the more flexible
IMA signature in order to support software upgrades and sealing to the more
secure exact binary image.

-- 
Daniel De Graaf
National Security Agency

  parent reply	other threads:[~2013-10-07 15:07 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-23 18:14 [PATCH 00/13] TPM cleanup Jason Gunthorpe
2013-09-23 18:14 ` [PATCH 01/13] tpm: ibmvtpm: Use %zd formatting for size_t format arguments Jason Gunthorpe
2013-10-01 21:58   ` Peter Hüwe
2013-10-02 19:37   ` [tpmdd-devel] " Ashley D Lai
2013-09-23 18:14 ` [PATCH 02/13] tpm atmel: Call request_region with the correct base Jason Gunthorpe
     [not found]   ` <201310020000.13490.PeterHuewe@gmx.de>
2013-10-03  0:11     ` [tpmdd-devel] " Ashley D Lai
2013-10-03  4:36       ` Jason Gunthorpe
2013-10-04 17:21         ` Joel Schopp
2013-09-23 18:14 ` [PATCH 03/13] tpm: xen-tpmfront: Fix default durations Jason Gunthorpe
2013-09-23 18:51   ` Konrad Rzeszutek Wilk
2013-09-23 18:57     ` Daniel De Graaf
2013-09-23 18:14 ` [PATCH 04/13] tpm: Store devname in the tpm_chip Jason Gunthorpe
2013-10-04 15:57   ` [tpmdd-devel] " Ashley Lai
2013-09-23 18:14 ` [PATCH 05/13] tpm: Use container_of to locate the tpm_chip in tpm_open Jason Gunthorpe
2013-10-05  1:47   ` [tpmdd-devel] " Ashley Lai
2013-09-23 18:14 ` [PATCH 06/13] tpm: Remove redundant dev_set_drvdata Jason Gunthorpe
2013-10-05  2:14   ` [tpmdd-devel] " Ashley Lai
2013-09-23 18:14 ` [PATCH 07/13] tpm: Remove tpm_show_caps_1_2 Jason Gunthorpe
     [not found]   ` <201310020009.22952.PeterHuewe@gmx.de>
2013-10-01 22:21     ` Jason Gunthorpe
2013-10-01 22:38       ` [tpmdd-devel] " Peter Hüwe
2013-09-23 18:14 ` [PATCH 08/13] tpm: Pull everything related to /dev/tpmX into tpm-dev.c Jason Gunthorpe
2013-10-01 22:52   ` Peter Hüwe
2013-10-01 22:57     ` Jason Gunthorpe
2013-10-01 23:14       ` Peter Hüwe
2013-10-01 23:23         ` Jason Gunthorpe
2013-10-03  5:05         ` Jason Gunthorpe
2013-10-04 15:50           ` TPM.ko module rename (was tpm: Pull everything related to /dev/tpmX into tpm-dev.c) Peter Hüwe
2013-10-04 16:28             ` Jason Gunthorpe
2013-10-04 16:45               ` Ashley Lai
2013-09-23 18:14 ` [PATCH 09/13] tpm: Pull everything related to sysfs into tpm-sysfs.c Jason Gunthorpe
2013-09-23 18:54   ` [tpmdd-devel] " Daniel De Graaf
2013-09-23 19:36     ` Jason Gunthorpe
2013-09-23 20:20       ` Daniel De Graaf
2013-09-23 20:42         ` Jason Gunthorpe
2013-09-23 22:00           ` Daniel De Graaf
2013-09-23 22:23             ` Jason Gunthorpe
2013-09-24 14:28               ` Daniel De Graaf
2013-09-30 18:10                 ` Jason Gunthorpe
2013-09-30 20:36                   ` Daniel De Graaf
2013-09-30 21:20                     ` Jason Gunthorpe
2013-09-30 22:09                     ` Joel Schopp
2013-10-04 17:08                       ` Jason Gunthorpe
2013-10-04 19:17                         ` Stefan Berger
2013-10-04 22:02                           ` Peter Hüwe
2013-10-07 15:06                           ` Daniel De Graaf [this message]
2013-10-08  9:15                         ` AW: [TrouSerS-tech] " Fuchs, Andreas
2013-10-09 17:38                           ` Jason Gunthorpe
2013-10-10  7:42                             ` AW: " Fuchs, Andreas
2013-10-10 16:50                               ` Jason Gunthorpe
2013-09-23 18:14 ` [PATCH 10/13] tpm: Create a tpm_class_ops structure and use it in the drivers Jason Gunthorpe
2013-09-23 18:14 ` [PATCH 11/13] tpm: Use the ops structure instead of a copy in tpm_vendor_specific Jason Gunthorpe
2013-09-23 18:14 ` [PATCH 12/13] tpm: st33: Remove chip->data_buffer access from this driver Jason Gunthorpe
2013-09-23 18:14 ` [PATCH 13/13] tpm: Make tpm-dev allocate a per-file structure Jason Gunthorpe
2013-09-23 21:27 ` [tpmdd-devel] [PATCH 00/13] TPM cleanup Joel Schopp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5252CDF2.4090304@tycho.nsa.gov \
    --to=dgdegra@tycho.nsa.gov \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=leosilva@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@srajiv.net \
    --cc=richardm@br.ibm.com \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@sirrix.com \
    --cc=trousers-tech@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox