All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about VTPM Implementation
@ 2014-03-12 12:32 Shuaijun Zhang
  2014-03-12 13:51 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 13+ messages in thread
From: Shuaijun Zhang @ 2014-03-12 12:32 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 313 bytes --]

Hi There,

In the document of VTPM (http://xenbits.xen.org/docs/unstable/misc/vtpm.txt
): The Linux dom0 kernel should not try accessing the TPM while the
vTPM Manager
domain is accessing it.

Anyone knows the reason why the dom0 should not access the TPM while vTPM
Mgr is accessing it?

Thanks & Regards,
Jason

[-- Attachment #1.2: Type: text/html, Size: 993 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Question about VTPM Implementation
  2014-03-12 12:32 Question about VTPM Implementation Shuaijun Zhang
@ 2014-03-12 13:51 ` Konrad Rzeszutek Wilk
  2014-03-12 14:35   ` Ian Campbell
  2014-03-12 14:37   ` [PATCH] docs/vtpm: explain dom0 physical TPM access caveats Daniel De Graaf
  0 siblings, 2 replies; 13+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-03-12 13:51 UTC (permalink / raw)
  To: Shuaijun Zhang, dgdegra; +Cc: xen-devel

On Wed, Mar 12, 2014 at 12:32:24PM +0000, Shuaijun Zhang wrote:
> Hi There,
> 
> In the document of VTPM (http://xenbits.xen.org/docs/unstable/misc/vtpm.txt
> ): The Linux dom0 kernel should not try accessing the TPM while the
> vTPM Manager
> domain is accessing it.
> 
> Anyone knows the reason why the dom0 should not access the TPM while vTPM
> Mgr is accessing it?

Lets rope in the maintainer. Perhaps the doc should be updated to explain
this.

> 
> Thanks & Regards,
> Jason

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Question about VTPM Implementation
  2014-03-12 13:51 ` Konrad Rzeszutek Wilk
@ 2014-03-12 14:35   ` Ian Campbell
  2014-03-12 14:37   ` [PATCH] docs/vtpm: explain dom0 physical TPM access caveats Daniel De Graaf
  1 sibling, 0 replies; 13+ messages in thread
From: Ian Campbell @ 2014-03-12 14:35 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Shuaijun Zhang, dgdegra, xen-devel

On Wed, 2014-03-12 at 09:51 -0400, Konrad Rzeszutek Wilk wrote:
> On Wed, Mar 12, 2014 at 12:32:24PM +0000, Shuaijun Zhang wrote:
> > Hi There,
> > 
> > In the document of VTPM (http://xenbits.xen.org/docs/unstable/misc/vtpm.txt
> > ): The Linux dom0 kernel should not try accessing the TPM while the
> > vTPM Manager
> > domain is accessing it.
> > 
> > Anyone knows the reason why the dom0 should not access the TPM while vTPM
> > Mgr is accessing it?

Surely this is just the classic two masters accessing a single resource
issue. No good can come from having domains poking the same bit of
hardware at the same time!

> 
> Lets rope in the maintainer. Perhaps the doc should be updated to explain
> this.
> 
> > 
> > Thanks & Regards,
> > Jason
> 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] docs/vtpm: explain dom0 physical TPM access caveats
  2014-03-12 13:51 ` Konrad Rzeszutek Wilk
  2014-03-12 14:35   ` Ian Campbell
@ 2014-03-12 14:37   ` Daniel De Graaf
  2014-03-12 15:20     ` Shuaijun Zhang
                       ` (2 more replies)
  1 sibling, 3 replies; 13+ messages in thread
From: Daniel De Graaf @ 2014-03-12 14:37 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk, Shuaijun Zhang; +Cc: xen-devel

On 03/12/2014 09:51 AM, Konrad Rzeszutek Wilk wrote:
> On Wed, Mar 12, 2014 at 12:32:24PM +0000, Shuaijun Zhang wrote:
>> Hi There,
>>
>> In the document of VTPM (http://xenbits.xen.org/docs/unstable/misc/vtpm.txt
>> ): The Linux dom0 kernel should not try accessing the TPM while the
>> vTPM Manager
>> domain is accessing it.
>>
>> Anyone knows the reason why the dom0 should not access the TPM while vTPM
>> Mgr is accessing it?
>
> Lets rope in the maintainer. Perhaps the doc should be updated to explain
> this.
>
>>
>> Thanks & Regards,
>> Jason

I agree; this docs patch explains the reasoning behind the original guidance
and addresses use cases that cannot yet be handled by a virtual TPM.

----------------------------->8--------------------------------

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
  docs/misc/vtpm.txt | 22 ++++++++++++++++++----
  1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
index df1dfae..d20b424 100644
--- a/docs/misc/vtpm.txt
+++ b/docs/misc/vtpm.txt
@@ -120,10 +120,24 @@ the stubdom tree.
  Compiling the LINUX dom0 kernel:
  --------------------------------
  
-The Linux dom0 kernel should not try accessing the TPM while the vTPM
-Manager domain is accessing it; the simplest way to accomplish this is
-to ensure the kernel is compiled without a driver for the TPM, or avoid
-loading the driver by blacklisting the module.
+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.  If dom0 needs a TPM but does not need to use it during
+the boot process (i.e. it is not using IMA), a virtual TPM can be attached to
+dom0 after the system is booted.
+
+Because the TPM manager does not yet accept requests for deep quotes, if a quote
+or other request needs to be fulfilled by the physical TPM, dom0 will need to
+access the physical TPM.  In order to prevent interference, the TPM Manager and
+dom0 should use different values for the TPM's locality; since Linux always uses
+locality 0, using locality 2 for the TPM Manager is recommended.  If both Linux
+and the TPM Manager attempt to access the TPM at the same time, the TPM device
+will return a busy status; some applications will consider this a fatal error
+instead of retrying the command at a later time.  If a vTPM gets an error when
+loading its key, it will currently generate a fresh vTPM image (with a new EK,
+SRK, and blank NVRAM).
+
  
  Compiling the LINUX domU kernel:
  --------------------------------

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] docs/vtpm: explain dom0 physical TPM access caveats
  2014-03-12 14:37   ` [PATCH] docs/vtpm: explain dom0 physical TPM access caveats Daniel De Graaf
@ 2014-03-12 15:20     ` Shuaijun Zhang
  2014-03-12 16:36     ` Shuaijun Zhang
  2014-03-13 11:10     ` Ian Campbell
  2 siblings, 0 replies; 13+ messages in thread
From: Shuaijun Zhang @ 2014-03-12 15:20 UTC (permalink / raw)
  To: Daniel De Graaf; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 3187 bytes --]

Thank you for the answer.
Is the docs patch already in the git repository, or where can I see this
patch.

Thank you,
Jason



On 12 March 2014 14:37, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:

> On 03/12/2014 09:51 AM, Konrad Rzeszutek Wilk wrote:
>
>> On Wed, Mar 12, 2014 at 12:32:24PM +0000, Shuaijun Zhang wrote:
>>
>>> Hi There,
>>>
>>> In the document of VTPM (http://xenbits.xen.org/docs/
>>> unstable/misc/vtpm.txt
>>> ): The Linux dom0 kernel should not try accessing the TPM while the
>>> vTPM Manager
>>> domain is accessing it.
>>>
>>> Anyone knows the reason why the dom0 should not access the TPM while vTPM
>>> Mgr is accessing it?
>>>
>>
>> Lets rope in the maintainer. Perhaps the doc should be updated to explain
>> this.
>>
>>
>>> Thanks & Regards,
>>> Jason
>>>
>>
> I agree; this docs patch explains the reasoning behind the original
> guidance
> and addresses use cases that cannot yet be handled by a virtual TPM.
>
> ----------------------------->8--------------------------------
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>  docs/misc/vtpm.txt | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
> index df1dfae..d20b424 100644
> --- a/docs/misc/vtpm.txt
> +++ b/docs/misc/vtpm.txt
> @@ -120,10 +120,24 @@ the stubdom tree.
>  Compiling the LINUX dom0 kernel:
>  --------------------------------
>  -The Linux dom0 kernel should not try accessing the TPM while the vTPM
> -Manager domain is accessing it; the simplest way to accomplish this is
> -to ensure the kernel is compiled without a driver for the TPM, or avoid
> -loading the driver by blacklisting the module.
> +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.  If dom0 needs a TPM but does not need to use it
> during
> +the boot process (i.e. it is not using IMA), a virtual TPM can be
> attached to
> +dom0 after the system is booted.
> +
> +Because the TPM manager does not yet accept requests for deep quotes, if
> a quote
> +or other request needs to be fulfilled by the physical TPM, dom0 will
> need to
> +access the physical TPM.  In order to prevent interference, the TPM
> Manager and
> +dom0 should use different values for the TPM's locality; since Linux
> always uses
> +locality 0, using locality 2 for the TPM Manager is recommended.  If both
> Linux
> +and the TPM Manager attempt to access the TPM at the same time, the TPM
> device
> +will return a busy status; some applications will consider this a fatal
> error
> +instead of retrying the command at a later time.  If a vTPM gets an error
> when
> +loading its key, it will currently generate a fresh vTPM image (with a
> new EK,
> +SRK, and blank NVRAM).
> +
>   Compiling the LINUX domU kernel:
>  --------------------------------
>



-- 
Shuaijun Zhang
Research Engineer
Software Research Institute,
Athlone Institute of Technology, IE
Tel: +353 90 646 8196
http://www.ait.ie/sri/

[-- Attachment #1.2: Type: text/html, Size: 4305 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] docs/vtpm: explain dom0 physical TPM access caveats
  2014-03-12 14:37   ` [PATCH] docs/vtpm: explain dom0 physical TPM access caveats Daniel De Graaf
  2014-03-12 15:20     ` Shuaijun Zhang
@ 2014-03-12 16:36     ` Shuaijun Zhang
  2014-03-12 18:39       ` Daniel De Graaf
  2014-03-13 11:10     ` Ian Campbell
  2 siblings, 1 reply; 13+ messages in thread
From: Shuaijun Zhang @ 2014-03-12 16:36 UTC (permalink / raw)
  To: Daniel De Graaf; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 3342 bytes --]

That explains the reason.
But If the dom0 can't access the TPM, you will not be able to verify the
dom0 system & the boot process. Is it not a security risk?
Is there any solution that allows me to use vTPM and also be able to verify
the dom0 system(host system)?

Regards,
Jason


On 12 March 2014 14:37, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:

> On 03/12/2014 09:51 AM, Konrad Rzeszutek Wilk wrote:
>
>> On Wed, Mar 12, 2014 at 12:32:24PM +0000, Shuaijun Zhang wrote:
>>
>>> Hi There,
>>>
>>> In the document of VTPM (http://xenbits.xen.org/docs/
>>> unstable/misc/vtpm.txt
>>> ): The Linux dom0 kernel should not try accessing the TPM while the
>>> vTPM Manager
>>> domain is accessing it.
>>>
>>> Anyone knows the reason why the dom0 should not access the TPM while vTPM
>>> Mgr is accessing it?
>>>
>>
>> Lets rope in the maintainer. Perhaps the doc should be updated to explain
>> this.
>>
>>
>>> Thanks & Regards,
>>> Jason
>>>
>>
> I agree; this docs patch explains the reasoning behind the original
> guidance
> and addresses use cases that cannot yet be handled by a virtual TPM.
>
> ----------------------------->8--------------------------------
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>  docs/misc/vtpm.txt | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
> index df1dfae..d20b424 100644
> --- a/docs/misc/vtpm.txt
> +++ b/docs/misc/vtpm.txt
> @@ -120,10 +120,24 @@ the stubdom tree.
>  Compiling the LINUX dom0 kernel:
>  --------------------------------
>  -The Linux dom0 kernel should not try accessing the TPM while the vTPM
> -Manager domain is accessing it; the simplest way to accomplish this is
> -to ensure the kernel is compiled without a driver for the TPM, or avoid
> -loading the driver by blacklisting the module.
> +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.  If dom0 needs a TPM but does not need to use it
> during
> +the boot process (i.e. it is not using IMA), a virtual TPM can be
> attached to
> +dom0 after the system is booted.
> +
> +Because the TPM manager does not yet accept requests for deep quotes, if
> a quote
> +or other request needs to be fulfilled by the physical TPM, dom0 will
> need to
> +access the physical TPM.  In order to prevent interference, the TPM
> Manager and
> +dom0 should use different values for the TPM's locality; since Linux
> always uses
> +locality 0, using locality 2 for the TPM Manager is recommended.  If both
> Linux
> +and the TPM Manager attempt to access the TPM at the same time, the TPM
> device
> +will return a busy status; some applications will consider this a fatal
> error
> +instead of retrying the command at a later time.  If a vTPM gets an error
> when
> +loading its key, it will currently generate a fresh vTPM image (with a
> new EK,
> +SRK, and blank NVRAM).
> +
>   Compiling the LINUX domU kernel:
>  --------------------------------
>



-- 
Shuaijun Zhang
Research Engineer
Software Research Institute,
Athlone Institute of Technology, IE
Tel: +353 90 646 8196
http://www.ait.ie/sri/

[-- Attachment #1.2: Type: text/html, Size: 4476 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] docs/vtpm: explain dom0 physical TPM access caveats
  2014-03-12 16:36     ` Shuaijun Zhang
@ 2014-03-12 18:39       ` Daniel De Graaf
  2014-03-12 23:04         ` Shuaijun Zhang
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel De Graaf @ 2014-03-12 18:39 UTC (permalink / raw)
  To: Shuaijun Zhang; +Cc: xen-devel

On 03/12/2014 12:36 PM, Shuaijun Zhang wrote:
> That explains the reason.
> But If the dom0 can't access the TPM, you will not be able to verify the
> dom0 system & the boot process. Is it not a security risk?
> Is there any solution that allows me to use vTPM and also be able to verify
> the dom0 system(host system)?
>
> Regards,
> Jason

At the moment, you need to give dom0 access to the physical TPM to verify
the boot process/hypervisor.  I have an updated TPM Manager and vTPM domain
for Xen 4.5 that supports a "deep quote" operation, using the hardware TPM
to produce a quote of pTPM and vTPM PCR values; I plan to post this later
today.

>
> On 12 March 2014 14:37, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>
>> On 03/12/2014 09:51 AM, Konrad Rzeszutek Wilk wrote:
>>
>>> On Wed, Mar 12, 2014 at 12:32:24PM +0000, Shuaijun Zhang wrote:
>>>
>>>> Hi There,
>>>>
>>>> In the document of VTPM (http://xenbits.xen.org/docs/
>>>> unstable/misc/vtpm.txt
>>>> ): The Linux dom0 kernel should not try accessing the TPM while the
>>>> vTPM Manager
>>>> domain is accessing it.
>>>>
>>>> Anyone knows the reason why the dom0 should not access the TPM while vTPM
>>>> Mgr is accessing it?
>>>>
>>>
>>> Lets rope in the maintainer. Perhaps the doc should be updated to explain
>>> this.
>>>
>>>
>>>> Thanks & Regards,
>>>> Jason
>>>>
>>>
>> I agree; this docs patch explains the reasoning behind the original
>> guidance
>> and addresses use cases that cannot yet be handled by a virtual TPM.
>>
>> ----------------------------->8--------------------------------
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   docs/misc/vtpm.txt | 22 ++++++++++++++++++----
>>   1 file changed, 18 insertions(+), 4 deletions(-)
>>
>> diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
>> index df1dfae..d20b424 100644
>> --- a/docs/misc/vtpm.txt
>> +++ b/docs/misc/vtpm.txt
>> @@ -120,10 +120,24 @@ the stubdom tree.
>>   Compiling the LINUX dom0 kernel:
>>   --------------------------------
>>   -The Linux dom0 kernel should not try accessing the TPM while the vTPM
>> -Manager domain is accessing it; the simplest way to accomplish this is
>> -to ensure the kernel is compiled without a driver for the TPM, or avoid
>> -loading the driver by blacklisting the module.
>> +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.  If dom0 needs a TPM but does not need to use it
>> during
>> +the boot process (i.e. it is not using IMA), a virtual TPM can be
>> attached to
>> +dom0 after the system is booted.
>> +
>> +Because the TPM manager does not yet accept requests for deep quotes, if
>> a quote
>> +or other request needs to be fulfilled by the physical TPM, dom0 will
>> need to
>> +access the physical TPM.  In order to prevent interference, the TPM
>> Manager and
>> +dom0 should use different values for the TPM's locality; since Linux
>> always uses
>> +locality 0, using locality 2 for the TPM Manager is recommended.  If both
>> Linux
>> +and the TPM Manager attempt to access the TPM at the same time, the TPM
>> device
>> +will return a busy status; some applications will consider this a fatal
>> error
>> +instead of retrying the command at a later time.  If a vTPM gets an error
>> when
>> +loading its key, it will currently generate a fresh vTPM image (with a
>> new EK,
>> +SRK, and blank NVRAM).
>> +
>>    Compiling the LINUX domU kernel:
>>   --------------------------------
>>
>
>
>


-- 
Daniel De Graaf
National Security Agency

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] docs/vtpm: explain dom0 physical TPM access caveats
  2014-03-12 18:39       ` Daniel De Graaf
@ 2014-03-12 23:04         ` Shuaijun Zhang
  2014-03-12 23:41           ` Daniel De Graaf
  0 siblings, 1 reply; 13+ messages in thread
From: Shuaijun Zhang @ 2014-03-12 23:04 UTC (permalink / raw)
  To: Daniel De Graaf; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 4422 bytes --]

Thank you so much for the new patches. It is great to see the new patches
of vTPM allow to attest both of the dom0 and VMs.
I found the commit message of the patches here:
http://www.gossamer-threads.com/lists/xen/devel/320297. But I can't find
the repository. Can you please point me out where is the source code
repository

Thank you



On 12 March 2014 18:39, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:

> On 03/12/2014 12:36 PM, Shuaijun Zhang wrote:
>
>> That explains the reason.
>> But If the dom0 can't access the TPM, you will not be able to verify the
>> dom0 system & the boot process. Is it not a security risk?
>> Is there any solution that allows me to use vTPM and also be able to
>> verify
>> the dom0 system(host system)?
>>
>> Regards,
>> Jason
>>
>
> At the moment, you need to give dom0 access to the physical TPM to verify
> the boot process/hypervisor.  I have an updated TPM Manager and vTPM domain
> for Xen 4.5 that supports a "deep quote" operation, using the hardware TPM
> to produce a quote of pTPM and vTPM PCR values; I plan to post this later
> today.
>
>
>
>> On 12 March 2014 14:37, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>
>>  On 03/12/2014 09:51 AM, Konrad Rzeszutek Wilk wrote:
>>>
>>>  On Wed, Mar 12, 2014 at 12:32:24PM +0000, Shuaijun Zhang wrote:
>>>>
>>>>  Hi There,
>>>>>
>>>>> In the document of VTPM (http://xenbits.xen.org/docs/
>>>>> unstable/misc/vtpm.txt
>>>>> ): The Linux dom0 kernel should not try accessing the TPM while the
>>>>> vTPM Manager
>>>>> domain is accessing it.
>>>>>
>>>>> Anyone knows the reason why the dom0 should not access the TPM while
>>>>> vTPM
>>>>> Mgr is accessing it?
>>>>>
>>>>>
>>>> Lets rope in the maintainer. Perhaps the doc should be updated to
>>>> explain
>>>> this.
>>>>
>>>>
>>>>  Thanks & Regards,
>>>>> Jason
>>>>>
>>>>>
>>>>  I agree; this docs patch explains the reasoning behind the original
>>> guidance
>>> and addresses use cases that cannot yet be handled by a virtual TPM.
>>>
>>> ----------------------------->8--------------------------------
>>>
>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>> ---
>>>   docs/misc/vtpm.txt | 22 ++++++++++++++++++----
>>>   1 file changed, 18 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
>>> index df1dfae..d20b424 100644
>>> --- a/docs/misc/vtpm.txt
>>> +++ b/docs/misc/vtpm.txt
>>> @@ -120,10 +120,24 @@ the stubdom tree.
>>>   Compiling the LINUX dom0 kernel:
>>>   --------------------------------
>>>   -The Linux dom0 kernel should not try accessing the TPM while the vTPM
>>> -Manager domain is accessing it; the simplest way to accomplish this is
>>> -to ensure the kernel is compiled without a driver for the TPM, or avoid
>>> -loading the driver by blacklisting the module.
>>> +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.  If dom0 needs a TPM but does not need to use
>>> it
>>> during
>>> +the boot process (i.e. it is not using IMA), a virtual TPM can be
>>> attached to
>>> +dom0 after the system is booted.
>>> +
>>> +Because the TPM manager does not yet accept requests for deep quotes, if
>>> a quote
>>> +or other request needs to be fulfilled by the physical TPM, dom0 will
>>> need to
>>> +access the physical TPM.  In order to prevent interference, the TPM
>>> Manager and
>>> +dom0 should use different values for the TPM's locality; since Linux
>>> always uses
>>> +locality 0, using locality 2 for the TPM Manager is recommended.  If
>>> both
>>> Linux
>>> +and the TPM Manager attempt to access the TPM at the same time, the TPM
>>> device
>>> +will return a busy status; some applications will consider this a fatal
>>> error
>>> +instead of retrying the command at a later time.  If a vTPM gets an
>>> error
>>> when
>>> +loading its key, it will currently generate a fresh vTPM image (with a
>>> new EK,
>>> +SRK, and blank NVRAM).
>>> +
>>>    Compiling the LINUX domU kernel:
>>>   --------------------------------
>>>
>>>
>>
>>
>>
>
> --
> Daniel De Graaf
> National Security Agency
>



-- 
Shuaijun Zhang
Research Engineer
Software Research Institute,
Athlone Institute of Technology, IE
Tel: +353 90 646 8196
http://www.ait.ie/sri/

[-- Attachment #1.2: Type: text/html, Size: 6128 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] docs/vtpm: explain dom0 physical TPM access caveats
  2014-03-12 23:04         ` Shuaijun Zhang
@ 2014-03-12 23:41           ` Daniel De Graaf
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel De Graaf @ 2014-03-12 23:41 UTC (permalink / raw)
  To: Shuaijun Zhang; +Cc: xen-devel

On 03/12/2014 07:04 PM, Shuaijun Zhang wrote:
> Thank you so much for the new patches. It is great to see the new patches
> of vTPM allow to attest both of the dom0 and VMs.
> I found the commit message of the patches here:
> http://www.gossamer-threads.com/lists/xen/devel/320297. But I can't find
> the repository. Can you please point me out where is the source code
> repository
>
> Thank you

There is no repository with these commits yet (other than the git repository
on my computer where they were developed). You can import these patches into
your repository using "git am" (or by manually applying the patches) to test.

There will also be some follow-on patches adding support scripts to generate
the administrative command messages and addressing certain instances where
physical TPMs do not exactly conform to the specification.  The scripts I
have been using for testing are not really suitable for general use, so were
not included in this series.

> On 12 March 2014 18:39, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>
>> On 03/12/2014 12:36 PM, Shuaijun Zhang wrote:
>>
>>> That explains the reason.
>>> But If the dom0 can't access the TPM, you will not be able to verify the
>>> dom0 system & the boot process. Is it not a security risk?
>>> Is there any solution that allows me to use vTPM and also be able to
>>> verify
>>> the dom0 system(host system)?
>>>
>>> Regards,
>>> Jason
>>>
>>
>> At the moment, you need to give dom0 access to the physical TPM to verify
>> the boot process/hypervisor.  I have an updated TPM Manager and vTPM domain
>> for Xen 4.5 that supports a "deep quote" operation, using the hardware TPM
>> to produce a quote of pTPM and vTPM PCR values; I plan to post this later
>> today.
>>
>>
>>
>>> On 12 March 2014 14:37, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>>
>>>   On 03/12/2014 09:51 AM, Konrad Rzeszutek Wilk wrote:
>>>>
>>>>   On Wed, Mar 12, 2014 at 12:32:24PM +0000, Shuaijun Zhang wrote:
>>>>>
>>>>>   Hi There,
>>>>>>
>>>>>> In the document of VTPM (http://xenbits.xen.org/docs/
>>>>>> unstable/misc/vtpm.txt
>>>>>> ): The Linux dom0 kernel should not try accessing the TPM while the
>>>>>> vTPM Manager
>>>>>> domain is accessing it.
>>>>>>
>>>>>> Anyone knows the reason why the dom0 should not access the TPM while
>>>>>> vTPM
>>>>>> Mgr is accessing it?
>>>>>>
>>>>>>
>>>>> Lets rope in the maintainer. Perhaps the doc should be updated to
>>>>> explain
>>>>> this.
>>>>>
>>>>>
>>>>>   Thanks & Regards,
>>>>>> Jason
>>>>>>
>>>>>>
>>>>>   I agree; this docs patch explains the reasoning behind the original
>>>> guidance
>>>> and addresses use cases that cannot yet be handled by a virtual TPM.
>>>>
>>>> ----------------------------->8--------------------------------
>>>>
>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>> ---
>>>>    docs/misc/vtpm.txt | 22 ++++++++++++++++++----
>>>>    1 file changed, 18 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
>>>> index df1dfae..d20b424 100644
>>>> --- a/docs/misc/vtpm.txt
>>>> +++ b/docs/misc/vtpm.txt
>>>> @@ -120,10 +120,24 @@ the stubdom tree.
>>>>    Compiling the LINUX dom0 kernel:
>>>>    --------------------------------
>>>>    -The Linux dom0 kernel should not try accessing the TPM while the vTPM
>>>> -Manager domain is accessing it; the simplest way to accomplish this is
>>>> -to ensure the kernel is compiled without a driver for the TPM, or avoid
>>>> -loading the driver by blacklisting the module.
>>>> +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.  If dom0 needs a TPM but does not need to use
>>>> it
>>>> during
>>>> +the boot process (i.e. it is not using IMA), a virtual TPM can be
>>>> attached to
>>>> +dom0 after the system is booted.
>>>> +
>>>> +Because the TPM manager does not yet accept requests for deep quotes, if
>>>> a quote
>>>> +or other request needs to be fulfilled by the physical TPM, dom0 will
>>>> need to
>>>> +access the physical TPM.  In order to prevent interference, the TPM
>>>> Manager and
>>>> +dom0 should use different values for the TPM's locality; since Linux
>>>> always uses
>>>> +locality 0, using locality 2 for the TPM Manager is recommended.  If
>>>> both
>>>> Linux
>>>> +and the TPM Manager attempt to access the TPM at the same time, the TPM
>>>> device
>>>> +will return a busy status; some applications will consider this a fatal
>>>> error
>>>> +instead of retrying the command at a later time.  If a vTPM gets an
>>>> error
>>>> when
>>>> +loading its key, it will currently generate a fresh vTPM image (with a
>>>> new EK,
>>>> +SRK, and blank NVRAM).
>>>> +
>>>>     Compiling the LINUX domU kernel:
>>>>    --------------------------------
>>>>
>>>>
>>>
>>>
>>>
>>
>> --
>> Daniel De Graaf
>> National Security Agency
>>
>
>
>


-- 
Daniel De Graaf
National Security Agency

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] docs/vtpm: explain dom0 physical TPM access caveats
  2014-03-12 14:37   ` [PATCH] docs/vtpm: explain dom0 physical TPM access caveats Daniel De Graaf
  2014-03-12 15:20     ` Shuaijun Zhang
  2014-03-12 16:36     ` Shuaijun Zhang
@ 2014-03-13 11:10     ` Ian Campbell
  2014-03-13 14:53       ` Daniel De Graaf
  2 siblings, 1 reply; 13+ messages in thread
From: Ian Campbell @ 2014-03-13 11:10 UTC (permalink / raw)
  To: Daniel De Graaf; +Cc: Shuaijun Zhang, xen-devel

On Wed, 2014-03-12 at 10:37 -0400, Daniel De Graaf wrote:
> On 03/12/2014 09:51 AM, Konrad Rzeszutek Wilk wrote:
> > On Wed, Mar 12, 2014 at 12:32:24PM +0000, Shuaijun Zhang wrote:
> >> Hi There,
> >>
> >> In the document of VTPM (http://xenbits.xen.org/docs/unstable/misc/vtpm.txt
> >> ): The Linux dom0 kernel should not try accessing the TPM while the
> >> vTPM Manager
> >> domain is accessing it.
> >>
> >> Anyone knows the reason why the dom0 should not access the TPM while vTPM
> >> Mgr is accessing it?
> >
> > Lets rope in the maintainer. Perhaps the doc should be updated to explain
> > this.
> >
> >>
> >> Thanks & Regards,
> >> Jason
> 
> I agree; this docs patch explains the reasoning behind the original guidance
> and addresses use cases that cannot yet be handled by a virtual TPM.
> 
> ----------------------------->8--------------------------------
> 
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

I tried to apply but it failed because the title lines (and the
underlines) in the context are one space further indented than the copy
in the tree. This happened with your previous patch to this file too (I
fixed it up that time).

Do you have another patch in your queue which does this reformatting or
is something mangling things?

> ---
>   docs/misc/vtpm.txt | 22 ++++++++++++++++++----
>   1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
> index df1dfae..d20b424 100644
> --- a/docs/misc/vtpm.txt
> +++ b/docs/misc/vtpm.txt
> @@ -120,10 +120,24 @@ the stubdom tree.
>   Compiling the LINUX dom0 kernel:
>   --------------------------------
>   
> -The Linux dom0 kernel should not try accessing the TPM while the vTPM
> -Manager domain is accessing it; the simplest way to accomplish this is
> -to ensure the kernel is compiled without a driver for the TPM, or avoid
> -loading the driver by blacklisting the module.
> +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.  If dom0 needs a TPM but does not need to use it during
> +the boot process (i.e. it is not using IMA), a virtual TPM can be attached to
> +dom0 after the system is booted.
> +
> +Because the TPM manager does not yet accept requests for deep quotes, if a quote
> +or other request needs to be fulfilled by the physical TPM, dom0 will need to
> +access the physical TPM.  In order to prevent interference, the TPM Manager and
> +dom0 should use different values for the TPM's locality; since Linux always uses
> +locality 0, using locality 2 for the TPM Manager is recommended.  If both Linux
> +and the TPM Manager attempt to access the TPM at the same time, the TPM device
> +will return a busy status; some applications will consider this a fatal error
> +instead of retrying the command at a later time.  If a vTPM gets an error when
> +loading its key, it will currently generate a fresh vTPM image (with a new EK,
> +SRK, and blank NVRAM).
> +
>   
>   Compiling the LINUX domU kernel:
>   --------------------------------
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] docs/vtpm: explain dom0 physical TPM access caveats
  2014-03-13 11:10     ` Ian Campbell
@ 2014-03-13 14:53       ` Daniel De Graaf
  2014-03-13 15:59         ` Ian Campbell
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel De Graaf @ 2014-03-13 14:53 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Shuaijun Zhang, xen-devel

On 03/13/2014 07:10 AM, Ian Campbell wrote:
> On Wed, 2014-03-12 at 10:37 -0400, Daniel De Graaf wrote:
>> On 03/12/2014 09:51 AM, Konrad Rzeszutek Wilk wrote:
>>> On Wed, Mar 12, 2014 at 12:32:24PM +0000, Shuaijun Zhang wrote:
>>>> Hi There,
>>>>
>>>> In the document of VTPM (http://xenbits.xen.org/docs/unstable/misc/vtpm.txt
>>>> ): The Linux dom0 kernel should not try accessing the TPM while the
>>>> vTPM Manager
>>>> domain is accessing it.
>>>>
>>>> Anyone knows the reason why the dom0 should not access the TPM while vTPM
>>>> Mgr is accessing it?
>>>
>>> Lets rope in the maintainer. Perhaps the doc should be updated to explain
>>> this.
>>>
>>>>
>>>> Thanks & Regards,
>>>> Jason
>>
>> I agree; this docs patch explains the reasoning behind the original guidance
>> and addresses use cases that cannot yet be handled by a virtual TPM.
>>
>> ----------------------------->8--------------------------------
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
> I tried to apply but it failed because the title lines (and the
> underlines) in the context are one space further indented than the copy
> in the tree. This happened with your previous patch to this file too (I
> fixed it up that time).
>
> Do you have another patch in your queue which does this reformatting or
> is something mangling things?

I think Thunderbird is to blame here; I made sure to base this patch on top
of xen/staging rather than my work branch, and copy/pasted directly from
the patch output.  I probably need to revert to using git-send-email as my
mail client for sending these patches in the future.

>> ---
>>    docs/misc/vtpm.txt | 22 ++++++++++++++++++----
>>    1 file changed, 18 insertions(+), 4 deletions(-)
>>
>> diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
>> index df1dfae..d20b424 100644
>> --- a/docs/misc/vtpm.txt
>> +++ b/docs/misc/vtpm.txt
>> @@ -120,10 +120,24 @@ the stubdom tree.
>>    Compiling the LINUX dom0 kernel:
>>    --------------------------------
>>
>> -The Linux dom0 kernel should not try accessing the TPM while the vTPM
>> -Manager domain is accessing it; the simplest way to accomplish this is
>> -to ensure the kernel is compiled without a driver for the TPM, or avoid
>> -loading the driver by blacklisting the module.
>> +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.  If dom0 needs a TPM but does not need to use it during
>> +the boot process (i.e. it is not using IMA), a virtual TPM can be attached to
>> +dom0 after the system is booted.
>> +
>> +Because the TPM manager does not yet accept requests for deep quotes, if a quote
>> +or other request needs to be fulfilled by the physical TPM, dom0 will need to
>> +access the physical TPM.  In order to prevent interference, the TPM Manager and
>> +dom0 should use different values for the TPM's locality; since Linux always uses
>> +locality 0, using locality 2 for the TPM Manager is recommended.  If both Linux
>> +and the TPM Manager attempt to access the TPM at the same time, the TPM device
>> +will return a busy status; some applications will consider this a fatal error
>> +instead of retrying the command at a later time.  If a vTPM gets an error when
>> +loading its key, it will currently generate a fresh vTPM image (with a new EK,
>> +SRK, and blank NVRAM).
>> +
>>
>>    Compiling the LINUX domU kernel:
>>    --------------------------------
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>
>


-- 
Daniel De Graaf
National Security Agency

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] docs/vtpm: explain dom0 physical TPM access caveats
  2014-03-13 14:53       ` Daniel De Graaf
@ 2014-03-13 15:59         ` Ian Campbell
  2014-03-14 11:01           ` Ian Campbell
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Campbell @ 2014-03-13 15:59 UTC (permalink / raw)
  To: Daniel De Graaf; +Cc: Shuaijun Zhang, xen-devel

On Thu, 2014-03-13 at 10:53 -0400, Daniel De Graaf wrote:
> On 03/13/2014 07:10 AM, Ian Campbell wrote:
> > Do you have another patch in your queue which does this reformatting or
> > is something mangling things?
> 
> I think Thunderbird is to blame here;

Almost always ;-)

>  I made sure to base this patch on top
> of xen/staging rather than my work branch, and copy/pasted directly from
> the patch output.  I probably need to revert to using git-send-email as my
> mail client for sending these patches in the future.

That would be good, thanks.

I think I can fix this one up on commit though.

Ian.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] docs/vtpm: explain dom0 physical TPM access caveats
  2014-03-13 15:59         ` Ian Campbell
@ 2014-03-14 11:01           ` Ian Campbell
  0 siblings, 0 replies; 13+ messages in thread
From: Ian Campbell @ 2014-03-14 11:01 UTC (permalink / raw)
  To: Daniel De Graaf; +Cc: Shuaijun Zhang, xen-devel

On Thu, 2014-03-13 at 15:59 +0000, Ian Campbell wrote:
> I think I can fix this one up on commit though.

Done and applied, thanks.

Ian.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-03-14 11:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-12 12:32 Question about VTPM Implementation Shuaijun Zhang
2014-03-12 13:51 ` Konrad Rzeszutek Wilk
2014-03-12 14:35   ` Ian Campbell
2014-03-12 14:37   ` [PATCH] docs/vtpm: explain dom0 physical TPM access caveats Daniel De Graaf
2014-03-12 15:20     ` Shuaijun Zhang
2014-03-12 16:36     ` Shuaijun Zhang
2014-03-12 18:39       ` Daniel De Graaf
2014-03-12 23:04         ` Shuaijun Zhang
2014-03-12 23:41           ` Daniel De Graaf
2014-03-13 11:10     ` Ian Campbell
2014-03-13 14:53       ` Daniel De Graaf
2014-03-13 15:59         ` Ian Campbell
2014-03-14 11:01           ` Ian Campbell

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.