Re: [Xen-devel] [PATCH v3 00/14] Enable vTPM subsystem on TPM 2.0

2015-01-19 Thread Xu, Quan


> -Original Message-
> From: Daniel De Graaf [mailto:dgde...@tycho.nsa.gov]
> Sent: Tuesday, January 13, 2015 11:54 PM
> To: Xu, Quan; xen-devel@lists.xen.org
> Cc: stefano.stabell...@eu.citrix.com; samuel.thiba...@ens-lyon.org;
> ian.campb...@citrix.com; ian.jack...@eu.citrix.com; jbeul...@suse.com;
> k...@xen.org; t...@xen.org
> Subject: Re: [PATCH v3 00/14] Enable vTPM subsystem on TPM 2.0
> 
> On 01/12/2015 11:06 AM, Xu, Quan wrote:
> > Graaf,
> > Now there are no more comments for this series of patch.
> > Can this series of patch be merged in staging branch? or any other AR, let 
> > me
> know.
> > If the series of patch are in staging branch, the Community and I can 
> > continue
> to develop and enhance it.
> 
> A few remaining comments:
> 
> Patch 6 adds an #if 0 block; is this test code that you meant to remove?
> 
> Patch 9 (see reply).
> 
> Are you planning to replace TPM2_Bind with TPM2_Seal in a later series?
> If so, please make a note of this limitation in the documentation for TPM2, 
> since
> using PCRs to seal the data can be an important security feature that users 
> of the
> vtpmmgr rely on.
> 
> For the other patches in this series (1-5,7-8,10):
> Acked-by: Daniel De Graaf 
> 
> With patch #14 documenting the lack of TPM2 sealing, #11-13 are also Acked.
> 
> - Daniel
> 


Thanks for your review.
I have sent out v4 based on your remaining comments. Could you help me check it 
again? Thanks.
The subject is "[PATCH v4 00/14] Enable vTPM subsystem on TPM 2.0"

-Quan

> 
> --
> Daniel De Graaf
> National Security Agency
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v3 00/14] Enable vTPM subsystem on TPM 2.0

2015-01-13 Thread Xu, Quan


> -Original Message-
> From: Daniel De Graaf [mailto:dgde...@tycho.nsa.gov]
> Sent: Tuesday, January 13, 2015 11:54 PM
> To: Xu, Quan; xen-devel@lists.xen.org
> Cc: stefano.stabell...@eu.citrix.com; samuel.thiba...@ens-lyon.org;
> ian.campb...@citrix.com; ian.jack...@eu.citrix.com; jbeul...@suse.com;
> k...@xen.org; t...@xen.org
> Subject: Re: [PATCH v3 00/14] Enable vTPM subsystem on TPM 2.0
> 
> On 01/12/2015 11:06 AM, Xu, Quan wrote:
> > Graaf,
> > Now there are no more comments for this series of patch.
> > Can this series of patch be merged in staging branch? or any other AR, let 
> > me
> know.
> > If the series of patch are in staging branch, the Community and I can 
> > continue
> to develop and enhance it.
> 
> A few remaining comments:
> 
> Patch 6 adds an #if 0 block; is this test code that you meant to remove?
> 

Thanks,
It is just an example how to bind/unbind. I will remove it in v4 and send out 
v4 ASAP.

> Patch 9 (see reply).
> 

I will fix it.

> Are you planning to replace TPM2_Bind with TPM2_Seal in a later series?
> If so, please make a note of this limitation in the documentation for TPM2, 
> since
> using PCRs to seal the data can be an important security feature that users 
> of the
> vtpmmgr rely on.

Yes, I will replace TPM2_Bind with TPM2_Seal in a later series.

> 
> For the other patches in this series (1-5,7-8,10):
> Acked-by: Daniel De Graaf 
> 
> With patch #14 documenting the lack of TPM2 sealing, #11-13 are also Acked.
> 
I will fix the Patch#14 documenting the lack of TPM2 sealing in v4.
Thanks again.


Quan

> - Daniel
> 
> >
> > Thanks
> > Quan
> >
> >> -Original Message-
> >> From: Xu, Quan
> >> Sent: Wednesday, December 31, 2014 1:50 PM
> >> To: xen-devel@lists.xen.org
> >> Cc: dgde...@tycho.nsa.gov; stefano.stabell...@eu.citrix.com;
> >> samuel.thiba...@ens-lyon.org; ian.campb...@citrix.com;
> >> ian.jack...@eu.citrix.com; jbeul...@suse.com; k...@xen.org;
> >> t...@xen.org; Xu, Quan
> >> Subject: [PATCH v3 00/14] Enable vTPM subsystem on TPM 2.0
> >>
> >> ###
> >> # Happy New Year..#
> >> ###
> >>
> >> This series of patch enable the virtual Trusted Platform Module
> >> (vTPM) subsystem for Xen on TPM 2.0.
> >>
> >> Noted, functionality for a virtual guest operating system (a DomU) is
> >> still TPM 1.2. The main modifcation is on vtpmmgr-stubdom. The
> >> challenge is that TPM
> >> 2.0 is not backward compatible with TPM 1.2.
> >>
> >> --
> >> DESIGN OVERVIEW
> >> --
> >> The architecture of vTPM subsystem on TPM 2.0 is described below:
> >>
> >> +--+
> >> |Linux DomU| ...
> >> |   |  ^   |
> >> |   v  |   |
> >> |   xen-tpmfront   |
> >> +--+
> >>  |  ^
> >>  v  |
> >> +--+
> >> | mini-os/tpmback  |
> >> |   |  ^   |
> >> |   v  |   |
> >> |  vtpm-stubdom| ...
> >> |   |  ^   |
> >> |   v  |   |
> >> | mini-os/tpmfront |
> >> +--+
> >>  |  ^
> >>  v  |
> >> +--+
> >> | mini-os/tpmback  |
> >> |   |  ^   |
> >> |   v  |   |
> >> | vtpmmgr-stubdom  |
> >> |   |  ^   |
> >> |   v  |   |
> >> | mini-os/tpm2_tis |
> >> +--+
> >>  |  ^
> >>  v  |
> >> +--+
> >> | Hardware TPM 2.0 |
> >> +--+
> >>   * Linux DomU: The Linux based guest that wants to use a vTPM. There
> >> many be
> >> more than one of these.
> >>
> >>   * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
> >>  provides vTPM access to a para-virtualized Linux
> >> based DomU.
> >>
> >>   * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
> >>  connects to this backend driver to facilitate
> >>  communications between the Linux DomU and its
> >> vTPM. This
> >>  driver is also used by vtpmmgr-stubdom to
> >> communicate with
> >>  vtpm-stubdom.
> >>
> >>   * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is
> a
> >>   one to one mapping between running vtpm-stubdom
> >> instances and
> >>   logical vtpms on the system. The vTPM Platform
> >> Configuration
> >>   Registers (PCRs) are all initialized to zero.
> >>
> >>   * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os
> domain
> >>   vtpm-stubdom uses this driver to communicate
> with
> >>   vtpmmgr-stubdom. This driver could also be used
> >> separately to
> >>   implement a mini-os domain that wishes to use a
> >> vTPM of
> >>   its own.
> >>   * vtpmmgr-stubdom: A mini-os domain that implements the vTPM
> manager.
> >> There is only one vTPM manager and it

Re: [Xen-devel] [PATCH v3 00/14] Enable vTPM subsystem on TPM 2.0

2015-01-13 Thread Daniel De Graaf

On 01/12/2015 11:06 AM, Xu, Quan wrote:

Graaf,
Now there are no more comments for this series of patch.
Can this series of patch be merged in staging branch? or any other AR, let me 
know.
If the series of patch are in staging branch, the Community and I can continue 
to develop and enhance it.


A few remaining comments:

Patch 6 adds an #if 0 block; is this test code that you meant to remove?

Patch 9 (see reply).

Are you planning to replace TPM2_Bind with TPM2_Seal in a later series?
If so, please make a note of this limitation in the documentation for TPM2,
since using PCRs to seal the data can be an important security feature that
users of the vtpmmgr rely on.

For the other patches in this series (1-5,7-8,10):
Acked-by: Daniel De Graaf 

With patch #14 documenting the lack of TPM2 sealing, #11-13 are also Acked.

- Daniel



Thanks
Quan


-Original Message-
From: Xu, Quan
Sent: Wednesday, December 31, 2014 1:50 PM
To: xen-devel@lists.xen.org
Cc: dgde...@tycho.nsa.gov; stefano.stabell...@eu.citrix.com;
samuel.thiba...@ens-lyon.org; ian.campb...@citrix.com;
ian.jack...@eu.citrix.com; jbeul...@suse.com; k...@xen.org; t...@xen.org; Xu,
Quan
Subject: [PATCH v3 00/14] Enable vTPM subsystem on TPM 2.0

###
# Happy New Year..#
###

This series of patch enable the virtual Trusted Platform Module (vTPM)
subsystem for Xen on TPM 2.0.

Noted, functionality for a virtual guest operating system (a DomU) is still TPM
1.2. The main modifcation is on vtpmmgr-stubdom. The challenge is that TPM
2.0 is not backward compatible with TPM 1.2.

--
DESIGN OVERVIEW
--
The architecture of vTPM subsystem on TPM 2.0 is described below:

+--+
|Linux DomU| ...
|   |  ^   |
|   v  |   |
|   xen-tpmfront   |
+--+
 |  ^
 v  |
+--+
| mini-os/tpmback  |
|   |  ^   |
|   v  |   |
|  vtpm-stubdom| ...
|   |  ^   |
|   v  |   |
| mini-os/tpmfront |
+--+
 |  ^
 v  |
+--+
| mini-os/tpmback  |
|   |  ^   |
|   v  |   |
| vtpmmgr-stubdom  |
|   |  ^   |
|   v  |   |
| mini-os/tpm2_tis |
+--+
 |  ^
 v  |
+--+
| Hardware TPM 2.0 |
+--+
  * Linux DomU: The Linux based guest that wants to use a vTPM. There many
be
more than one of these.

  * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
 provides vTPM access to a para-virtualized Linux based
DomU.

  * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
 connects to this backend driver to facilitate
 communications between the Linux DomU and its
vTPM. This
 driver is also used by vtpmmgr-stubdom to
communicate with
 vtpm-stubdom.

  * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
  one to one mapping between running vtpm-stubdom
instances and
  logical vtpms on the system. The vTPM Platform
Configuration
  Registers (PCRs) are all initialized to zero.

  * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
  vtpm-stubdom uses this driver to communicate with
  vtpmmgr-stubdom. This driver could also be used
separately to
  implement a mini-os domain that wishes to use a
vTPM of
  its own.
  * vtpmmgr-stubdom: A mini-os domain that implements the vTPM manager.
There is only one vTPM manager and it should be running
during
the entire lifetime of the machine.  This domain regulates
access to the physical TPM on the system and secures the
persistent state of each vTPM.

  * mini-os/tpm2_tis: Mini-os TPM version 2.0 TPM Interface Specification (TIS)
 driver. This driver used by vtpmmgr-stubdom to talk
directly
 to the hardware TPM 2.0. Communication is facilitated
by mapping
 hardware memory pages into vtpmmgr-stubdom.

  * Hardware TPM 2.0: The physical TPM 2.0 that is soldered onto the
motherboard.


--
Key Hierarchy
--

 +--+
 |  vTPM's secrets  | ...
 +--+
 |  ^
 |  |(Bind / Unbind)
- - - - -  -v  |- - - - - - - - TPM 2.0
 +--+
 |SK+
 +--+
 |  ^
 v  |
 +--+
 |   SRK|
 +--+
 |  ^
 v  |
 +--+
 | TPM 2.0 Storage  |
 |   Primary Seed   |
 +--+

Re: [Xen-devel] [PATCH v3 00/14] Enable vTPM subsystem on TPM 2.0

2015-01-12 Thread Xu, Quan
Graaf,
Now there are no more comments for this series of patch. 
Can this series of patch be merged in staging branch? or any other AR, let me 
know. 
If the series of patch are in staging branch, the Community and I can continue 
to develop and enhance it.


Thanks 
Quan

> -Original Message-
> From: Xu, Quan
> Sent: Wednesday, December 31, 2014 1:50 PM
> To: xen-devel@lists.xen.org
> Cc: dgde...@tycho.nsa.gov; stefano.stabell...@eu.citrix.com;
> samuel.thiba...@ens-lyon.org; ian.campb...@citrix.com;
> ian.jack...@eu.citrix.com; jbeul...@suse.com; k...@xen.org; t...@xen.org; Xu,
> Quan
> Subject: [PATCH v3 00/14] Enable vTPM subsystem on TPM 2.0
> 
> ###
> # Happy New Year..#
> ###
> 
> This series of patch enable the virtual Trusted Platform Module (vTPM)
> subsystem for Xen on TPM 2.0.
> 
> Noted, functionality for a virtual guest operating system (a DomU) is still 
> TPM
> 1.2. The main modifcation is on vtpmmgr-stubdom. The challenge is that TPM
> 2.0 is not backward compatible with TPM 1.2.
> 
> --
> DESIGN OVERVIEW
> --
> The architecture of vTPM subsystem on TPM 2.0 is described below:
> 
> +--+
> |Linux DomU| ...
> |   |  ^   |
> |   v  |   |
> |   xen-tpmfront   |
> +--+
> |  ^
> v  |
> +--+
> | mini-os/tpmback  |
> |   |  ^   |
> |   v  |   |
> |  vtpm-stubdom| ...
> |   |  ^   |
> |   v  |   |
> | mini-os/tpmfront |
> +--+
> |  ^
> v  |
> +--+
> | mini-os/tpmback  |
> |   |  ^   |
> |   v  |   |
> | vtpmmgr-stubdom  |
> |   |  ^   |
> |   v  |   |
> | mini-os/tpm2_tis |
> +--+
> |  ^
> v  |
> +--+
> | Hardware TPM 2.0 |
> +--+
>  * Linux DomU: The Linux based guest that wants to use a vTPM. There many
> be
>more than one of these.
> 
>  * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
> provides vTPM access to a para-virtualized Linux based
> DomU.
> 
>  * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
> connects to this backend driver to facilitate
> communications between the Linux DomU and its
> vTPM. This
> driver is also used by vtpmmgr-stubdom to
> communicate with
> vtpm-stubdom.
> 
>  * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
>  one to one mapping between running vtpm-stubdom
> instances and
>  logical vtpms on the system. The vTPM Platform
> Configuration
>  Registers (PCRs) are all initialized to zero.
> 
>  * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
>  vtpm-stubdom uses this driver to communicate with
>  vtpmmgr-stubdom. This driver could also be used
> separately to
>  implement a mini-os domain that wishes to use a
> vTPM of
>  its own.
>  * vtpmmgr-stubdom: A mini-os domain that implements the vTPM manager.
>There is only one vTPM manager and it should be running
> during
>the entire lifetime of the machine.  This domain regulates
>access to the physical TPM on the system and secures the
>persistent state of each vTPM.
> 
>  * mini-os/tpm2_tis: Mini-os TPM version 2.0 TPM Interface Specification (TIS)
> driver. This driver used by vtpmmgr-stubdom to talk
> directly
> to the hardware TPM 2.0. Communication is facilitated
> by mapping
> hardware memory pages into vtpmmgr-stubdom.
> 
>  * Hardware TPM 2.0: The physical TPM 2.0 that is soldered onto the
> motherboard.
> 
> 
> --
> Key Hierarchy
> --
> 
> +--+
> |  vTPM's secrets  | ...
> +--+
> |  ^
> |  |(Bind / Unbind)
> - - - - -  -v  |- - - - - - - - TPM 2.0
> +--+
> |SK+
> +--+
> |  ^
> v  |
> +--+
> |   SRK|
> +--+
> |  ^
> v  |
> +--+
> | TPM 2.0 Storage  |
> |   Primary Seed   |
> +--+
> --
> INSTALLATION
> --
> 
> Prerequisites:
> --
> You must have an x86 machine with a TPM on the motherboard.  The only
> extra software requirement for compiling vTPM is cmake.  You must use libxl
> to manage domains with vTPMs; 'xm' is deprecated and does not support
> vTPMs.
> 
> Compiling the Xen tree:
> --

[Xen-devel] [PATCH v3 00/14] Enable vTPM subsystem on TPM 2.0

2014-12-31 Thread Quan Xu
###
# Happy New Year..#
###

This series of patch enable the virtual Trusted Platform Module (vTPM)
subsystem for Xen on TPM 2.0.

Noted, functionality for a virtual guest operating system (a DomU) is still
TPM 1.2. The main modifcation is on vtpmmgr-stubdom. The challenge is that
TPM 2.0 is not backward compatible with TPM 1.2.

--
DESIGN OVERVIEW
--
The architecture of vTPM subsystem on TPM 2.0 is described below:

+--+
|Linux DomU| ...
|   |  ^   |
|   v  |   |
|   xen-tpmfront   |
+--+
|  ^
v  |
+--+
| mini-os/tpmback  |
|   |  ^   |
|   v  |   |
|  vtpm-stubdom| ...
|   |  ^   |
|   v  |   |
| mini-os/tpmfront |
+--+
|  ^
v  |
+--+
| mini-os/tpmback  |
|   |  ^   |
|   v  |   |
| vtpmmgr-stubdom  |
|   |  ^   |
|   v  |   |
| mini-os/tpm2_tis |
+--+
|  ^
v  |
+--+
| Hardware TPM 2.0 |
+--+
 * Linux DomU: The Linux based guest that wants to use a vTPM. There many be
   more than one of these.

 * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
provides vTPM access to a para-virtualized Linux based DomU.

 * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
connects to this backend driver to facilitate
communications between the Linux DomU and its vTPM. This
driver is also used by vtpmmgr-stubdom to communicate with
vtpm-stubdom.

 * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
 one to one mapping between running vtpm-stubdom instances and
 logical vtpms on the system. The vTPM Platform Configuration
 Registers (PCRs) are all initialized to zero.

 * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
 vtpm-stubdom uses this driver to communicate with
 vtpmmgr-stubdom. This driver could also be used separately 
to
 implement a mini-os domain that wishes to use a vTPM of
 its own.
 * vtpmmgr-stubdom: A mini-os domain that implements the vTPM manager.
   There is only one vTPM manager and it should be running during
   the entire lifetime of the machine.  This domain regulates
   access to the physical TPM on the system and secures the
   persistent state of each vTPM.

 * mini-os/tpm2_tis: Mini-os TPM version 2.0 TPM Interface Specification (TIS)
driver. This driver used by vtpmmgr-stubdom to talk directly
to the hardware TPM 2.0. Communication is facilitated by 
mapping
hardware memory pages into vtpmmgr-stubdom.

 * Hardware TPM 2.0: The physical TPM 2.0 that is soldered onto the motherboard.


--
Key Hierarchy
--

+--+
|  vTPM's secrets  | ...
+--+
|  ^
|  |(Bind / Unbind)
- - - - -  -v  |- - - - - - - - TPM 2.0
+--+
|SK+
+--+
|  ^
v  |
+--+
|   SRK|
+--+
|  ^
v  |
+--+
| TPM 2.0 Storage  |
|   Primary Seed   |
+--+
--
INSTALLATION
--

Prerequisites:
--
You must have an x86 machine with a TPM on the motherboard.  The only extra
software requirement for compiling vTPM is cmake.  You must use libxl to manage
domains with vTPMs; 'xm' is deprecated and does not support vTPMs.

Compiling the Xen tree:
---

Compile and install the Xen tree as usual; be sure that the vTPM domains are
enabled when you run configure.

Compiling the LINUX dom0 kernel:


Because the TPM manager uses direct access to the physical TPM, it may interfere
with access to the TPM by dom0.  The simplest solution for this is to prevent
dom0 from accessing the physical TPM by compiling the kernel without a driver or
blacklisting the module.

Compiling the LINUX domU kernel:


The domU kernel used by domains with vtpms must include the xen-tpmfront.ko
driver. It can be built directly into the kernel or as a module; however, some
features such as IMA require the TPM to be built in to the kernel.


CONFIG_TCG_TPM=y
CONFIG_TCG_XEN=y

--
VTPM MANAGER SETUP
--

Manager disk image setup:
-

The vTPM Manager req