Skip to contentSkip to conversation

get TPM applications to happily co-exist

tpm2 Ted Kim 3 participants 9 messages Apr 27, 2021 – Apr 28, 2021

lore
Share & tools
lore

Ted Kim

author
#0 lore raw

Folks,

The question has come up about how to get TPM applications to happily coexist with minimal coordination.

One issue in the owner hierarchy is we want each application to to be able to manage it's own objects but not affect those of the other applications.

So for example, we only want application A to be able to evict persistent handles owned by that application and not those of another application B.

If I understand, tpm2_evictcontrol command, the authorization is on the hierarchy and not on the object. Maybe I am thinking about this wrong, but is there a way in the authorization to look at some property of the object and tell who "owns" it and then figure out if this should be allowed or not ?

Otherwise, I think, we end up building some other software which knows how to authorize this on the hierarchy and keeps track of who owns what and then issues the eviction only when the owner of an object is the requester.

Am open to any suggestions.

Thanks,
-ted

#1 lore raw

Just my opinion:

The TPM has very few persistent key slots. They are typically reserved for early boot when there is no other persistent storage. Unless you have a restricted application, like an appliance, try not to use persistent keys because they may not be available.

Typically, keep your application's key on disk, load it when you need it, and flush it when you're done or your application exits.

~~

Your understanding is correct - persistent keys are created by the owner, a higher privileged role that will manage the few (perhaps 7 or less) key slots.

There are probably complex schemes, forget the owner auth and use an owner policy specific to each key. But, unless you have an appliance / embedded application, you don't control that.

Quoted 39 lines

From: Ted Kim <ted.h.kim(a)oracle.com>
To: tpm2(a)lists.01.org
Date: 04/27/2021 12:38 PM
Subject: [EXTERNAL] [tpm2] get TPM applications to happily co-exist

Folks,

The question has come up about how to get TPM applications to happily coexist with minimal coordination.

One issue in the owner hierarchy is we want each application to to be able to manage it's own objects but not affect those of the other applications.

So for example, we only want application A to be able to evict persistent handles owned by that application and not those of another application B.

If I understand, tpm2_evictcontrol command, the authorization is on the hierarchy and not on the object. Maybe I am thinking about this wrong, but is there a way in the authorization to look at some property of the object and tell who "owns" it and then figure out if this should be allowed or not ?

Otherwise, I think, we end up building some other software which knows how to authorize this on the hierarchy and keeps track of who owns what and then issues the eviction only when the owner of an object is the requester.

Am open to any suggestions.

Thanks,
-ted

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

author
#2 lore raw
In reply to Ted Kim

So it looks like Microsoft has done something to keep TPM-using applications out of each others way for Windows in "TPM Base Services".

Is someone doing something similar for Linux ?
Is FAPI supposed to eventually do stuff like this ?
Of course, I would rather use the accepted standard tool, instead of re-inventing the wheel.

Thanks,
-ted

Quoted 33 lines · Ted Kim

Folks,

The question has come up about how to get TPM applications to happily coexist with minimal coordination.

One issue in the owner hierarchy is we want each application to to be able to manage it's own objects but not affect those of the other applications.

So for example, we only want application A to be able to evict persistent handles owned by that application and not those of another application B.

If I understand, tpm2_evictcontrol command, the authorization is on the hierarchy and not on the object. Maybe I am thinking about this wrong, but is there a way in the authorization to look at some property of the object and tell who "owns" it and then figure out if this should be allowed or not ?

Otherwise, I think, we end up building some other software which knows how to authorize this on the hierarchy and keeps track of who owns what and then issues the eviction only when the owner of an object is the requester.

Am open to any suggestions.

Thanks,
-ted

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Signature · 3 lines
Ted H. Kim, PhD
ted.h.kim(a)oracle.com
+1 310-258-7515
#3 lore raw

The tpm2-abrmd as well as the in-kernel resource manager via /dev/tpmrm0 both perform isolation of "connections", i.e. each tss context (on all apis TCTI, SYS; ESYS, FAPI) has an isolated view on the TPM.

That even means if an application opens two ESYS context even they are isolated from each other. Helps a lot with large multi-module applications.

________________________________________
Von: Ted Kim <ted.h.kim(a)oracle.com>
Gesendet: Mittwoch, 28. April 2021 01:00
An: tpm2(a)lists.01.org
Betreff: [tpm2] Re: get TPM applications to happily co-exist

So it looks like Microsoft has done something to keep TPM-using applications out of each others way for Windows in "TPM Base Services".

Is someone doing something similar for Linux ?
Is FAPI supposed to eventually do stuff like this ?
Of course, I would rather use the accepted standard tool, instead of re-inventing the wheel.

Thanks,
-ted

Quoted 26 lines · Ted Kim

Folks,

The question has come up about how to get TPM applications to happily coexist with minimal coordination.

One issue in the owner hierarchy is we want each application to to be able to manage it's own objects but not affect those of the other applications.

So for example, we only want application A to be able to evict persistent handles owned by that application and not those of another application B.

If I understand, tpm2_evictcontrol command, the authorization is on the hierarchy and not on the object. Maybe I am thinking about this wrong, but is there a way in the authorization to look at some property of the object and tell who "owns" it and then figure out if this should be allowed or not ?

Otherwise, I think, we end up building some other software which knows how to authorize this on the hierarchy and keeps track of who owns what and then issues the eviction only when the owner of an object is the requester.

Am open to any suggestions.

Quoted 7 lines

Thanks,
-ted

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

--
Ted H. Kim, PhD
ted.h.kim(a)oracle.com
+1 310-258-7515
_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

author
#4 lore raw

[tpm2] Re: [External] : AW: Re: get TPM applications to happily co-exist

Andreas,

I certainly appreciate what the ABRMD or in-kernel resource manager does. But I think the MS TPM Base Services goes a bit further. Quoting something from a MS web page:

/Each context is only allowed to access virtual resources created specifically on its behalf, as well as the physical resources on the TPM that corresponds to those virtual resources. /

So for my situation, I am thinking if application A (using its own context) created some objects, application B (with a different context) would not even see them and would not be able to evict those persistent objects of the other application.

++++

Maybe in a VM environment maybe we could have multiple virtual TPMs (not just /dev/tpm0, but also /dev/tpm1 and tpm2, etc.) ? I suppose then each application could use it's own. However, I am not sure if the ABRMD or in-kernel resource manager would handle that (maybe also the virtualization SW won't do the right thing) ?

But of course in bare-metal, I am not aware any system which has more than one hardware TPM.

Thanks,
-ted

Quoted 64 lines · Andreas

The tpm2-abrmd as well as the in-kernel resource manager via /dev/tpmrm0 both perform isolation of "connections", i.e. each tss context (on all apis TCTI, SYS; ESYS, FAPI) has an isolated view on the TPM.

That even means if an application opens two ESYS context even they are isolated from each other. Helps a lot with large multi-module applications.

________________________________________
Von: Ted Kim <ted.h.kim(a)oracle.com>
Gesendet: Mittwoch, 28. April 2021 01:00
An: tpm2(a)lists.01.org
Betreff: [tpm2] Re: get TPM applications to happily co-exist

So it looks like Microsoft has done something to keep TPM-using applications out of each others way for Windows in "TPM Base Services".

Is someone doing something similar for Linux ?
Is FAPI supposed to eventually do stuff like this ?
Of course, I would rather use the accepted standard tool, instead of re-inventing the wheel.

Thanks,
-ted

Quoted 26 lines · Ted Kim

Folks,

The question has come up about how to get TPM applications to happily coexist with minimal coordination.

One issue in the owner hierarchy is we want each application to to be able to manage it's own objects but not affect those of the other applications.

So for example, we only want application A to be able to evict persistent handles owned by that application and not those of another application B.

If I understand, tpm2_evictcontrol command, the authorization is on the hierarchy and not on the object. Maybe I am thinking about this wrong, but is there a way in the authorization to look at some property of the object and tell who "owns" it and then figure out if this should be allowed or not ?

Otherwise, I think, we end up building some other software which knows how to authorize this on the hierarchy and keeps track of who owns what and then issues the eviction only when the owner of an object is the requester.

Am open to any suggestions.

Quoted 7 lines

Thanks,
-ted

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

--
Ted H. Kim, PhD
ted.h.kim(a)oracle.com
+1 310-258-7515
_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Signature · 3 lines
Ted H. Kim, PhD
ted.h.kim(a)oracle.com
+1 310-258-7515
#5 lore raw

[tpm2] Re: [External] : AW: Re: get TPM applications to happily co-exist

Ted, same thing.

The physical and virtual resources mentioned in the QUote are the transient key objects. The TBS as well as the tpm2-abrmd and tpmrm provide separation for these on a per-context basis.

(P.S. Microsoft is also a TCG member and tpm2-abrmd implements a TCG spec for resource managers. So this is not really a coincidence.)

I am pretty certain that the TBS does not include separation for persistent key object or let alone NV indices.

I'm afraid you are misinterpreting the Quoted statement.

Vor vTPMs you can look at the swtpm project of Stefan Berge with the vtpm-proxy option. This gives you additional /dev/tpm1,2,...

________________________________________
Von: Ted Kim <ted.h.kim(a)oracle.com>
Gesendet: Mittwoch, 28. April 2021 19:50
An: Fuchs, Andreas
Cc: tpm2(a)lists.01.org
Betreff: Re: [External] : AW: [tpm2] Re: get TPM applications to happily co-exist

Andreas,

I certainly appreciate what the ABRMD or in-kernel resource manager does. But I think the MS TPM Base Services goes a bit further. Quoting something from a MS web page:

Each context is only allowed to access virtual resources created specifically on its behalf, as well as the physical resources on the TPM that corresponds to those virtual resources.

So for my situation, I am thinking if application A (using its own context) created some objects, application B (with a different context) would not even see them and would not be able to evict those persistent objects of the other application.

++++

Maybe in a VM environment maybe we could have multiple virtual TPMs (not just /dev/tpm0, but also /dev/tpm1 and tpm2, etc.) ? I suppose then each application could use it's own. However, I am not sure if the ABRMD or in-kernel resource manager would handle that (maybe also the virtualization SW won't do the right thing) ?

But of course in bare-metal, I am not aware any system which has more than one hardware TPM.

Thanks,
-ted

On 4/28/21 1:15 AM, Fuchs, Andreas wrote:

The tpm2-abrmd as well as the in-kernel resource manager via /dev/tpmrm0 both perform isolation of "connections", i.e. each tss context (on all apis TCTI, SYS; ESYS, FAPI) has an isolated view on the TPM.

That even means if an application opens two ESYS context even they are isolated from each other. Helps a lot with large multi-module applications.

________________________________________
Von: Ted Kim <ted.h.kim(a)oracle.com><mailto:ted.h.kim(a)oracle.com>
Gesendet: Mittwoch, 28. April 2021 01:00
An: tpm2(a)lists.01.org<mailto:tpm2(a)lists.01.org>
Betreff: [tpm2] Re: get TPM applications to happily co-exist

So it looks like Microsoft has done something to keep TPM-using applications out of each others way for Windows in "TPM Base Services".

Is someone doing something similar for Linux ?
Is FAPI supposed to eventually do stuff like this ?
Of course, I would rather use the accepted standard tool, instead of re-inventing the wheel.

Thanks,
-ted

On 4/27/21 9:38 AM, Ted Kim wrote:

Folks,

The question has come up about how to get TPM applications to happily coexist with minimal coordination.

One issue in the owner hierarchy is we want each application to to be able to manage it's own objects but not affect those of the other applications.

So for example, we only want application A to be able to evict persistent handles owned by that application and not those of another application B.

If I understand, tpm2_evictcontrol command, the authorization is on the hierarchy and not on the object. Maybe I am thinking about this wrong, but is there a way in the authorization to look at some property of the object and tell who "owns" it and then figure out if this should be allowed or not ?

Otherwise, I think, we end up building some other software which knows how to authorize this on the hierarchy and keeps track of who owns what and then issues the eviction only when the owner of an object is the requester.

Am open to any suggestions.

Thanks,
-ted

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org<mailto:tpm2(a)lists.01.org>
To unsubscribe send an email to tpm2-leave(a)lists.01.org<mailto:tpm2-leave(a)lists.01.org> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

--
Ted H. Kim, PhD
ted.h.kim(a)oracle.com<mailto:ted.h.kim(a)oracle.com>
+1 310-258-7515
_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org<mailto:tpm2(a)lists.01.org>
To unsubscribe send an email to tpm2-leave(a)lists.01.org<mailto:tpm2-leave(a)lists.01.org> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

--
Ted H. Kim, PhD ted.h.kim(a)oracle.com<mailto:ted.h.kim(a)oracle.com> +1 310-258-7515

author
#6 lore raw

[tpm2] Re: [External] : AW: Re: get TPM applications to happily co-exist

Andreas,

OK, but then the problem of preventing other applications from evicting persistent objects from our application doesn't seem to have a solution, except by locking down the owner hierarchy (e.g. my application has the password) - which doesn't seem very friendly. How does any other application create a primary object, etc. ?

Anyway, thanks for the vtpm-proxy suggestion.

Thanks,
-ted

Quoted 115 lines · Andreas

Ted, same thing.

The physical and virtual resources mentioned in the QUote are the transient key objects. The TBS as well as the tpm2-abrmd and tpmrm provide separation for these on a per-context basis.

(P.S. Microsoft is also a TCG member and tpm2-abrmd implements a TCG spec for resource managers. So this is not really a coincidence.)

I am pretty certain that the TBS does not include separation for persistent key object or let alone NV indices.

I'm afraid you are misinterpreting the Quoted statement.

Vor vTPMs you can look at the swtpm project of Stefan Berge with the vtpm-proxy option. This gives you additional /dev/tpm1,2,...

________________________________________
Von: Ted Kim <ted.h.kim(a)oracle.com>
Gesendet: Mittwoch, 28. April 2021 19:50
An: Fuchs, Andreas
Cc: tpm2(a)lists.01.org
Betreff: Re: [External] : AW: [tpm2] Re: get TPM applications to happily co-exist

Andreas,

I certainly appreciate what the ABRMD or in-kernel resource manager does. But I think the MS TPM Base Services goes a bit further. Quoting something from a MS web page:

Each context is only allowed to access virtual resources created specifically on its behalf, as well as the physical resources on the TPM that corresponds to those virtual resources.

So for my situation, I am thinking if application A (using its own context) created some objects, application B (with a different context) would not even see them and would not be able to evict those persistent objects of the other application.

++++

Maybe in a VM environment maybe we could have multiple virtual TPMs (not just /dev/tpm0, but also /dev/tpm1 and tpm2, etc.) ? I suppose then each application could use it's own. However, I am not sure if the ABRMD or in-kernel resource manager would handle that (maybe also the virtualization SW won't do the right thing) ?

But of course in bare-metal, I am not aware any system which has more than one hardware TPM.

Thanks,
-ted

On 4/28/21 1:15 AM, Fuchs, Andreas wrote:

The tpm2-abrmd as well as the in-kernel resource manager via /dev/tpmrm0 both perform isolation of "connections", i.e. each tss context (on all apis TCTI, SYS; ESYS, FAPI) has an isolated view on the TPM.

That even means if an application opens two ESYS context even they are isolated from each other. Helps a lot with large multi-module applications.

________________________________________
Von: Ted Kim <ted.h.kim(a)oracle.com><mailto:ted.h.kim(a)oracle.com>
Gesendet: Mittwoch, 28. April 2021 01:00
An: tpm2(a)lists.01.org<mailto:tpm2(a)lists.01.org>
Betreff: [tpm2] Re: get TPM applications to happily co-exist

So it looks like Microsoft has done something to keep TPM-using applications out of each others way for Windows in "TPM Base Services".

Is someone doing something similar for Linux ?
Is FAPI supposed to eventually do stuff like this ?
Of course, I would rather use the accepted standard tool, instead of re-inventing the wheel.

Thanks,
-ted

On 4/27/21 9:38 AM, Ted Kim wrote:

Folks,

The question has come up about how to get TPM applications to happily coexist with minimal coordination.

One issue in the owner hierarchy is we want each application to to be able to manage it's own objects but not affect those of the other applications.

So for example, we only want application A to be able to evict persistent handles owned by that application and not those of another application B.

If I understand, tpm2_evictcontrol command, the authorization is on the hierarchy and not on the object. Maybe I am thinking about this wrong, but is there a way in the authorization to look at some property of the object and tell who "owns" it and then figure out if this should be allowed or not ?

Otherwise, I think, we end up building some other software which knows how to authorize this on the hierarchy and keeps track of who owns what and then issues the eviction only when the owner of an object is the requester.

Am open to any suggestions.

Thanks,
-ted

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org<mailto:tpm2(a)lists.01.org>
To unsubscribe send an email to tpm2-leave(a)lists.01.org<mailto:tpm2-leave(a)lists.01.org> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

--
Ted H. Kim, PhD
ted.h.kim(a)oracle.com<mailto:ted.h.kim(a)oracle.com>
+1 310-258-7515
_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org<mailto:tpm2(a)lists.01.org>
To unsubscribe send an email to tpm2-leave(a)lists.01.org<mailto:tpm2-leave(a)lists.01.org> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

--
Ted H. Kim, PhD ted.h.kim(a)oracle.com<mailto:ted.h.kim(a)oracle.com> +1 310-258-7515

Signature · 3 lines
Ted H. Kim, PhD
ted.h.kim(a)oracle.com
+1 310-258-7515
#7 lore raw

[tpm2] Re: : AW: Re: get TPM applications to happily co-exist

Quoted 7 lines

From: Ted Kim <ted.h.kim(a)oracle.com>

OK, but then the problem of preventing other applications from evicting persistent objects from our application doesn't seem to have a solution, except by locking down the owner hierarchy (e.g. my application has the password) - which doesn't seem very friendly. How does any other application create a primary object, etc. ?

A typical design has the owner create a primary storage key with an empty password and make it persistent at a standard handle.

That's similar to the TPM 1.2 SRK.

Each application creates a key hierarchy under that storage key, with whatever authorization they want.

The problem with a well-known owner auth is that everyone can Dos the TPM.

#8 lore raw
In reply to Ted Kim

The TPM specification dictates that the owner/storage hierarchy authorization is the authority over persistent objects. It makes sense in a way since EvictControl eats up TPM storage resources.

If you wanted isolation in the way you're describing you'd need to patch tpm2-abrmd in order to enforce some kind of access-control to EvictControl beyond the TPM's authorization scheme. But that would be enforced by the tpm2-abrmd daemon, not the TPM itself.

Hope this helps,
Andreas

________________________________________
Von: Ted Kim <ted.h.kim(a)oracle.com>
Gesendet: Dienstag, 27. April 2021 18:38
An: tpm2(a)lists.01.org
Betreff: [tpm2] get TPM applications to happily co-exist

Folks,

The question has come up about how to get TPM applications to happily coexist with minimal coordination.

One issue in the owner hierarchy is we want each application to to be able to manage it's own objects but not affect those of the other applications.

So for example, we only want application A to be able to evict persistent handles owned by that application and not those of another application B.

If I understand, tpm2_evictcontrol command, the authorization is on the hierarchy and not on the object. Maybe I am thinking about this wrong, but is there a way in the authorization to look at some property of the object and tell who "owns" it and then figure out if this should be allowed or not ?

Otherwise, I think, we end up building some other software which knows how to authorize this on the hierarchy and keeps track of who owns what and then issues the eviction only when the owner of an object is the requester.

Am open to any suggestions.

Thanks,
-ted

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s