All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Jordi Cucurull Juan <jordi.cucurull@scytl.com>,
	xen-devel@lists.xenproject.org
Subject: Re: Questions about the usage of the vTPM implemented in Xen 4.3
Date: Mon, 10 Feb 2014 14:40:58 -0500	[thread overview]
Message-ID: <52F92B4A.3010805@tycho.nsa.gov> (raw)
In-Reply-To: <52F26C40.2060901@scytl.com>

On 02/05/2014 11:52 AM, Jordi Cucurull Juan wrote:
> Dear all,
>
> I have recently configured a Xen 4.3 server with the vTPM enabled and a
> guest virtual machine that takes advantage of it. After playing a bit
> with it, I have a few questions:
>
> 1.According to the documentation, to shutdown the vTPM stubdom it is
> only needed to normally shutdown the guest VM. Theoretically, the vTPM
> stubdom automatically shuts down after this. Nevertheless, if I shutdown
> the guest the vTPM stubdom continues active and, moreover, I can start
> the machine again and the values of the vTPM are the last ones there
> were in the previous instance of the guest. Is this normal?

The documentation is in error here; while this was originally how the vTPM
domain behaved, this automatic shutdown was not reliable: it was not done
if the peer domain did not use the vTPM, and it was incorrectly triggered
by pv-grub's use of the vTPM to record guest kernel measurements (which was
the immediate reason for its removal). The solution now is to either send a
shutdown request or simply destroy the vTPM upon guest shutdown.

An alternative that may require less work on your part is to destroy
the vTPM stub domain during a guest's construction, something like:

#!/bin/sh -e
xl destroy "$1-vtpm" || true
xl create $1-vtpm.cfg
xl create $1-domu.cfg

Allowing a vTPM to remain active across a guest restart will cause the
PCR values extended by pv-grub to be incorrect, as you observed in your
second email. In order for the vTPM's PCRs to be useful for quotes or
releasing sealed secrets, you need to ensure that a new vTPM is started
if and only if it is paired with a corresponding guest.

> 2.In the documentation it is recommended to avoid accessing the physical
> TPM from Dom0 at the same time than the vTPM Manager stubdom.
> Nevertheless, I currently have the IMA and the Trousers enabled in Dom0
> without any apparent issue. Why is not recommended directly accessing
> the physical TPM of Dom0?

While most of the time it is not a problem to have two entities talking to
the physical TPM, it is possible for the trousers daemon in dom0 to interfere
with key handles used by the TPM Manager. There are also certain operations
of the TPM that may not handle concurrency, although I do not believe that
trousers uses them - SHA1Start, the DAA commands, and certain audit logs
come to mind.

The other reason why it is recommended to avoid pTPM access from dom0 is
because the ability to send unseal/unbind requests to the physical TPM makes
it possible for applications running in dom0 to decrypt the TPM Manager's
data (and thereby access vTPM private keys).

At present, sharing the physical TPM between dom0 and the TPM Manager is
the only way to get full integrity checks.

> 3.If it is not recommended to directly accessing the physical TPM in
> Dom0, which is the advisable way to check the integrity of this domain?
> With solutions such as TBOOT and IntelTXT?

While the TPM Manager in Xen 4.3/4.4 does not yet have this functionality,
an update which I will be submitting for inclusion in Xen 4.5 has the
ability to get physical TPM quotes using a virtual TPM. Combined with an
early domain builder, the eventual goal is to have dom0 use a vTPM for
its integrity/reporting/sealing operations, and use the physical TPM only
to secure the secrets of vTPMs and for deep quotes to provide fresh proofs
of the system's state.

> Best regards,
> Jordi.

-- 
Daniel De Graaf
National Security Agency

  parent reply	other threads:[~2014-02-10 19:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 16:52 Questions about the usage of the vTPM implemented in Xen 4.3 Jordi Cucurull Juan
2014-02-10 14:27 ` Ian Campbell
2014-02-10 17:23   ` Jordi Cucurull Juan
2014-02-10 19:40 ` Daniel De Graaf [this message]
2014-02-11  9:37   ` Ian Campbell
2014-02-11 15:25     ` [PATCH] docs/vtpm: fix auto-shutdown reference Daniel De Graaf
2014-02-12 17:22       ` Ian Campbell
2014-02-13  9:54         ` Ian Campbell
2014-02-11 10:01   ` Questions about the usage of the vTPM implemented in Xen 4.3 Jordi Cucurull Juan
2014-02-11 15:26     ` Daniel De Graaf
2014-02-12  9:38       ` Jordi Cucurull Juan
2014-02-12 19:07         ` Daniel De Graaf

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=52F92B4A.3010805@tycho.nsa.gov \
    --to=dgdegra@tycho.nsa.gov \
    --cc=jordi.cucurull@scytl.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.