tpm2-space: add handling for global session exhaustion
A message that is not in the archive (sent off-list or not yet received): [email protected]
On Feb 9, 11:24am, James Bottomley wrote:
} Subject: Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global sessi
Good morning to everyone.
Quoted 11 lines · Dr. Greg Wettstein
Quoted 6 lines
Referring back to Ken's comments about having 20+ clients waiting to get access to the hardware. Even with the focus in TPM2 on having it be more of a cryptographic accelerator are we convinced that the hardware is ever going to be fast enough for a model of having it directly service large numbers of transactions in something like a 'cloud' model?
It's already in use as such today:
https://tectonic.com/assets/pdf/TectonicTrustedComputing.pdf
We are familiar with this work. I'm not sure, however, that this work is representative of the notion of using TPM hardware to support a transactional environment, particularly at the cloud/container level.
There is not a great deal of technical detail on the CoreOS integrity architecture but it appears they are using TPM hardware to validate container integrity. I'm not sure this type of environment reflects the ability of TPM hardware to support transactional throughputs in an environment such as financial transaction processing.
Intel's Clear Container work cites the need to achieve container startup times of 150 milliseconds and they are currently claiming 45 milliseconds as their optimal time. This work was designed to demonstrate the feasibility of providing virtual machine isolation guarantees to containers and as such one of the mandates was to achieve container start times comparable to standard namespaces.
I ran some very rough timing metrics on one of our Skylake development systems with hardware TPM2 support. Here are the elapsed times for two common verification operations which I assume would be at the heart of generating any type of reasonable integrity guarantee:
quote: 810 milliseconds
verify signature: 635 milliseconds
This is with the verifying key loaded into the chip. The elapsed time to load and validate a key into the chip averages 1200 milliseconds. Since we are discussing a resource manager which would be shuttling context into and out of the limited resource slots on the chip I believe it is valid to consider this overhead as well.
This suggests that just a signature verification on the integrity of a container is a factor of 4.2 times greater then a well accepted start time metric for container technology.
Based on that I'm assuming that if TPM based integrity guarantees are being implemented they are only on ingress of the container into the cloud environment. I'm assuming an alternate methodology must be in place to protect against time of measurement/time of use issues.
Maybe people have better TPM2 hardware then what we have. I was going to run this on a Kaby Lake reference system but it appears that TXT is causing some type of context depletion problems which we we need to run down.
Quoted 1 line
We're also planning something like this in the IBM Cloud.
I assume if there is an expection of true transactional times you either will have better hardware then current generation TPM2 technology. Either that or I assume you will be using userspace simulators anchored with a hardware TPM trust root.
Ken's reflection of having 21-22 competing transactions would appear to have problematic latency issues given our measurements.
I influence engineering for a company which builds deterministically modeled Linux platforms. We've spent a lot of time considering TPM2 hardware bottlenecks since they constrain the rate at which we can validate platform behavioral measurements.
We have a variation of this work which allows SGX OCALL's to validate platform behavior in order to provide a broader TCB resource spectrum to the enclave and hardware TPM performance is problematic there as well.
Quoted 1 line
James
Have a good weekend.
Greg
}-- End of excerpt from James Bottomley
As always,
Dr. G.W. Wettstein, Ph.D. Enjellic Systems Development, LLC. 4206 N. 19th Ave. Specializing in information infra-structure Fargo, ND 58102 development.
PH: 701-281-1686
FAX: 701-281-3949 EMAIL: greg-R92VP3DqSWVWk0Htik3J/[email protected]
------------------------------------------------------------------------------
"After being a technician for 2 years, I've discovered if people took
care of their health with the same reckless abandon as their computers, half would be at the kitchen table on the phone with the hospital, trying to remove their appendix with a butter knife."
-- Brian Jones
Signature · 3 lines
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
A message that is not in the archive (sent off-list or not yet received): 201702101003.v1AA3plF029882-DHO+NtfOqB5PEDpkEIzg7wC/[email protected]
Quoted 5 lines · Dr. Greg Wettstein
On Feb 9, 11:24am, James Bottomley wrote:
} Subject: Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global sessiGood morning to everyone.
Is there any way you could fix your email client? It's setting In -Reply-To: headers like this
In-reply-to: James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/[email protected]> "Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion" (Feb 9, 11:24am)
Not using the message id breaks threading for everyone.
Quoted 11 lines
Quoted 10 lines · Dr. Greg Wettstein
Quoted 9 lines
Referring back to Ken's comments about having 20+ clients waiting to
get access to the hardware. Even with the focus in TPM2 on having it
be more of a cryptographic accelerator are we convinced that the hardware is ever going to be fast enough for a model of having it directly service large numbers of transactions in something like a
'cloud' model?
Quoted 8 lines
Quoted 3 lines
It's already in use as such today:
https://tectonic.com/assets/pdf/TectonicTrustedComputing.pdf
We are familiar with this work. I'm not sure, however, that this work is representative of the notion of using TPM hardware to support a transactional environment, particularly at the cloud/container level.
It allows for cloud clients to request attestations. The next step is to allow containers to provision key material and PCR locked blobs securely to the TPM for use by correctly attested containers all of those are cloud scale use cases.
Quoted 5 lines
There is not a great deal of technical detail on the CoreOS integrity architecture but it appears they are using TPM hardware to validate container integrity. I'm not sure this type of environment reflects the ability of TPM hardware to support transactional throughputs in an environment such as financial transaction processing.
OK, so in the cloud neither key provisioning nor attestation has a huge latency requirement. This appears to be your concern? All I'd say is that the fact that there are use cases that can work at cloud scale doesn't mean that every use case can.
Quoted 6 lines
Intel's Clear Container work cites the need to achieve container startup times of 150 milliseconds and they are currently claiming 45 milliseconds as their optimal time. This work was designed to demonstrate the feasibility of providing virtual machine isolation guarantees to containers and as such one of the mandates was to achieve container start times comparable to standard namespaces.
There are ephemeral container use cases where the lifetimes are of this order, but they're not every use case (In fact, even in the devops environment, they're still a minority).
Quoted 8 lines
I ran some very rough timing metrics on one of our Skylake development systems with hardware TPM2 support. Here are the elapsed times for two common verification operations which I assume would be at the heart of generating any type of reasonable integrity guarantee:
quote: 810 milliseconds
verify signature: 635 milliseconds
That's interesting, my Skylake system has these figures down around 100ms or so ... however, I agree that 100ms is the order of this.
Which is still significant compared to container start times.
Quoted 9 lines
This is with the verifying key loaded into the chip. The elapsed time to load and validate a key into the chip averages 1200 milliseconds. Since we are discussing a resource manager which would be shuttling context into and out of the limited resource slots on the chip I believe it is valid to consider this overhead as well.
This suggests that just a signature verification on the integrity of a container is a factor of 4.2 times greater then a well accepted start time metric for container technology.
Part of the way of reducing the latency is not to use the TPM for things that don't require secrecy: container signature verification is one such because the container is signed with a private key to which you know the public component ... you can verify it on the host without needing to trouble the TPM. We only use the TPM for state quotes, unsealing and signature generation.
Quoted 10 lines
Based on that I'm assuming that if TPM based integrity guarantees are being implemented they are only on ingress of the container into the cloud environment. I'm assuming an alternate methodology must be in place to protect against time of measurement/time of use issues.
Maybe people have better TPM2 hardware then what we have. I was going to run this on a Kaby Lake reference system but it appears that TXT is causing some type of context depletion problems which we we need to run down.
Quoted 6 lines
Quoted 1 line
We're also planning something like this in the IBM Cloud.
I assume if there is an expection of true transactional times you either will have better hardware then current generation TPM2 technology. Either that or I assume you will be using userspace simulators anchored with a hardware TPM trust root.
vTPM is a possibility, yes, so is making the TPM faster.
Quoted 2 lines
Ken's reflection of having 21-22 competing transactions would appear to have problematic latency issues given our measurements.
Consider the canonical use case to be VPNaaS with a secure connection back to the enterprise and the client key being the privacy guarded material. The signature generation is once per channel re-key and you have up to half the re-key interval to generate the re-key over the control channel. In this use case, latency isn't a problem (most re -key intervals are around 3000s) but volume is. VPNs are long running not short running, so start up time isn't hugely relevant either.
Anyway, precisely what we're doing and how is getting off point. The point is that there are existing cloud use cases for the TPM which can cause high concurrency.
James
Quoted 18 lines
I influence engineering for a company which builds deterministically modeled Linux platforms. We've spent a lot of time considering TPM2 hardware bottlenecks since they constrain the rate at which we can validate platform behavioral measurements.
We have a variation of this work which allows SGX OCALL's to validate platform behavior in order to provide a broader TCB resource spectrum to the enclave and hardware TPM performance is problematic there as well.
Quoted 1 line
James
Have a good weekend.
Greg
}-- End of excerpt from James Bottomley
Quoted 17 lines
As always,
Dr. G.W. Wettstein, Ph.D. Enjellic Systems Development, LLC.
4206 N. 19th Ave. Specializing in information infra
-structure
Fargo, ND 58102 development.
PH: 701-281-1686
FAX: 701-281-3949 EMAIL: greg-R92VP3DqSWVWk0Htik3J/[email protected]
---------------------------------------------------------------------
---------
"After being a technician for 2 years, I've discovered if people took
care of their health with the same reckless abandon as their
computers,
half would be at the kitchen table on the phone with the hospital,
trying
to remove their appendix with a butter knife."
-- Brian Jones
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
A message that is not in the archive (sent off-list or not yet received): 1486745163.2502.26.camel-d9PhHud1JfjCXq6kfMZ53/[email protected]
James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/[email protected]> wrote on 02/10/2017 11:46:03 AM:
Quoted 5 lines
Quoted 2 lines
quote: 810 milliseconds
verify signature: 635 millisecondsPart of the way of reducing the latency is not to use the TPM for things that don't require secrecy:
Agreed. There are a few times one would verify a signature inside the TPM,
but they're far from mainstream:
1 - Early in the boot cycle, when there's no crypto library.
2 - When the crypto library doesn't support the required algorithm.
3 - When a ticket is needed to prove to the TPM later that it verified the signature.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel
On Fri, Feb 10, 2017 at 04:13:05PM -0500, Kenneth Goldman wrote:
Good morning to everyone.
Quoted 5 lines
James Bottomley <[email protected]> wrote on 02/10/2017 11:46:03 AM:
Quoted 2 lines
Quoted 2 lines
quote: 810 milliseconds
verify signature: 635 milliseconds
For those who may be interested in this sort of thing I grabbed a few minutes and ran these basic verification primitives against a Kaby Lake system.
Average time for a quote is 600 milliseconds with a signature verification clocking in at 100 milliseconds. The latter is consistent with what James found on his Skylake machine.
Latencies are still significant with things like container start times.
Quoted 7 lines
Quoted 2 lines
Part of the way of reducing the latency is not to use the TPM for things that don't require secrecy:
Agreed. There are a few times one would verify a signature inside the TPM,
but they're far from mainstream:
Quoted 6 lines
1 - Early in the boot cycle, when there's no crypto library.
2 - When the crypto library doesn't support the required algorithm.
3 - When a ticket is needed to prove to the TPM later that it verified the signature.
I don't think there is any doubt that running cryptographic primitives in userspace is going to be faster then going to hardware. Obviously that also means there is no need for a TPM resource manager which has been the subject of much discussion here.
The CoreOS paper makes significant reference to increased security guarantees inherent in the use of a TPM. Obviously whatever uses those are will have the noted latency constraints.
We have extended our behavior measurement verifications to the container level so we offer an explicit guarantee that a container has not operated in a manner which is inconsistent with the intent of its designer. Getting the security guarantee we need requires that an linkage to a hardware root of trust hence our concerns about hardware latency.
Have a good day.
As always,
Dr. G.W. Wettstein, Ph.D. Enjellic Systems Development, LLC. 4206 N. 19th Ave. Specializing in information infra-structure Fargo, ND 58102 development.
PH: 701-281-1686
FAX: 701-281-3949 EMAIL: [email protected]
------------------------------------------------------------------------------
"UNIX is simple and coherent, but it takes a genious (or at any rate,
a programmer) to understand and appreciate its simplicity."
-- Dennis Ritchie
USENIX '87
A message that is not in the archive (sent off-list or not yet received): 20170214143829.GA28175-DHO+NtfOqB5PEDpkEIzg7wC/[email protected]
Quoted 31 lines · Dr. Greg Wettstein
On Fri, Feb 10, 2017 at 04:13:05PM -0500, Kenneth Goldman wrote:
Good morning to everyone.
Quoted 5 lines
James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/[email protected]> wrote on 02/10/2017 11:46:03 AM:
Quoted 2 lines
Quoted 2 lines
quote: 810 milliseconds
verify signature: 635 millisecondsFor those who may be interested in this sort of thing I grabbed a few minutes and ran these basic verification primitives against a Kaby Lake system.
Average time for a quote is 600 milliseconds with a signature verification clocking in at 100 milliseconds. The latter is consistent with what James found on his Skylake machine.
Latencies are still significant with things like container start times.
Quoted 10 lines
Quoted 2 lines
Part of the way of reducing the latency is not to use the TPM for things that don't require secrecy:
Agreed. There are a few times one would verify a signature inside the TPM, but they're far from mainstream:
1 - Early in the boot cycle, when there's no crypto library.
2 - When the crypto library doesn't support the required algorithm.
Quoted 8 lines
Quoted 3 lines
3 - When a ticket is needed to prove to the TPM later that it verified
the signature.I don't think there is any doubt that running cryptographic primitives in userspace is going to be faster then going to hardware.
Obviously that also means there is no need for a TPM resource
manager which has been the subject of much discussion here.
That's a bit of a non-sequitur. Ken's and my point was that although you could run every crypto operation through the TPM, you don't (as you say, because it's too slow), so you carefully select the ones that preserve the confidentiality you're looking for. To take the VPNaaS use case again: the key material you're protecting is the client identity key, so the only crypto operation you run through the TPM is creation of the TLS client certificate verification signature.
Everything else, including the server certificate signature verification, the symmetric key agreement and all the symmetric
encryption operations, you keep in userspace. That means that instead of requiring thousands of crypto operations per second from the TPM, you basically require about one per hour per VPNaaS instance.
We need a RM because without one, given the constraints of TPM2, as few as two VPNaaS instances can cause a resource exhaustion failure.
James
Quoted 13 lines
The CoreOS paper makes significant reference to increased security guarantees inherent in the use of a TPM. Obviously whatever uses those are will have the noted latency constraints.
We have extended our behavior measurement verifications to the container level so we offer an explicit guarantee that a container has not operated in a manner which is inconsistent with the intent of its designer. Getting the security guarantee we need requires that an linkage to a hardware root of trust hence our concerns about hardware latency.
Have a good day.
Quoted 14 lines
As always,
Dr. G.W. Wettstein, Ph.D. Enjellic Systems Development, LLC.
4206 N. 19th Ave. Specializing in information infra
-structure
Fargo, ND 58102 development.
PH: 701-281-1686
FAX: 701-281-3949 EMAIL: greg-R92VP3DqSWVWk0Htik3J/[email protected]
---------------------------------------------------------------------
---------
"UNIX is simple and coherent, but it takes a genious (or at any rate,
a programmer) to understand and appreciate its simplicity."
-- Dennis Ritchie
USENIX '87
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
A message that is not in the archive (sent off-list or not yet received): [email protected]
On Thu, Feb 16, 2017 at 09:04:47AM -0500, Ken Goldman wrote:
Good morning to everyone, leveraging some time between planes.
Quoted 9 lines · Dr. Greg Wettstein
Quoted 5 lines
I don't think there is any doubt that running cryptographic primitives in userspace is going to be faster then going to hardware. Obviously that also means there is no need for a TPM resource manager which has been the subject of much discussion here.
I don't understand that comment.
Quoted 7 lines
The resource manager schedules user space access to the TPM. It also handles swapping of objects in and out of the limited number of TPM slots.
Without a RM, either you'd have to permit only a single TPM connection, blocking all other connections, or you'd have different connections interfering with each other.
Yes, if multiple contexts of execution require access to the TPM a resource manager is needed to arbitrate that access.
I think, however, that we are talking past one another a bit.
We design and build systems which implement autonomous self-regulation. As such we need a hardware based confirmation that the machine is in a given behavioral state. This requires that we reference a hardware root of trust, ie. the TPM.
Depending on the assurance granularity requirements, that may mean a high rate of TPM verifications. When I noticed you and James talking about 'cloud based' levels of transactions I was assuming you were operating at transaction rates we build for, ie. 10-100's/second. That didn't seem feasible given our hardware measurements on Skylake and Kabylake based systems.
James had cited the CoreOS/Tectonic white paper as an example of TPM's working at cloud scale. Our conversation to date seems to indicate that the accepted modality of security appers to be to do userspace verification of container signatures. Given the extensive dialogue in the paper about using TPM's for security we had inadvertently believed that container verifications were being pinned to current platform status which didn't correlate with expected container start time latencies.
Our behavioral assessment code is namespaced so a supervisory system can make statements about the behavior of a container. We have concluded the only way that is possible is to use userspace TPM implementations which can meet the necessary latency requirements.
Our point in all this is that it doesn't seem to make any sense to implement anything in the kernel more then basic resource management. If other 'virtualization' is needed, such as session state management and the like, the community would seem to be served better by having a solid userspace simulation environment, with appropriate hardware security guarantees. That would serve needs like re-keying support for VPNaaS applications as well as high transaction rate environments, ie. why load the kernel with code to virtualize a resource when a 'user' can just be given its own TPM2 instance.
Just as an aside, has anyone given any thought about TPM2 resource management in things like TXT/tboot environments? The current tboot code makes a rather naive assumption that it can take a handle slot to protect its platform verification secret. Doing resource management correctly will require addressing extra-OS environments such as this which may have TPM2 state requirement issues.
Our take away from all this is that it doesn't seem that we need to worry about the fact that someone may have invented TPM2 hardware which is faster then what we are developing on.... :-)
Have a good weekend.
Greg
As always,
Dr. G.W. Wettstein, Ph.D. Enjellic Systems Development, LLC. 4206 N. 19th Ave. Specializing in information infra-structure Fargo, ND 58102 development.
PH: 701-281-1686
FAX: 701-281-3949 EMAIL: [email protected]
------------------------------------------------------------------------------
"If you ever teach a yodeling class, probably the hardest thing is to
keep the students from just trying to yodel right off. You see, we build to that."
-- Jack Handey
Deep Thoughts
Quoted 6 lines · Dr. Greg Wettstein
Just as an aside, has anyone given any thought about TPM2 resource management in things like TXT/tboot environments? The current tboot code makes a rather naive assumption that it can take a handle slot to protect its platform verification secret. Doing resource management correctly will require addressing extra-OS environments such as this which may have TPM2 state requirement issues.
The current implementation handles stuff created from regular /dev/tpm0 so I do not think this would be an issue. You can only access objects from a TPM space that are created within that space.
/Jarkko
On Thu, Feb 16, 2017 at 10:33:04PM +0200, Jarkko Sakkinen wrote:
Good morning to everyone.
Quoted 11 lines · Dr. Greg Wettstein
Quoted 6 lines
Just as an aside, has anyone given any thought about TPM2 resource management in things like TXT/tboot environments? The current tboot code makes a rather naive assumption that it can take a handle slot to protect its platform verification secret. Doing resource management correctly will require addressing extra-OS environments such as this which may have TPM2 state requirement issues.
The current implementation handles stuff created from regular
/dev/tpm0so I do not think this would be an issue. You can only access objects from a TPM space that are created within that space.
Unless I misunderstand the number of transient objects which can be managed is a characteristic of the hardware and is a limited resource, hence our discussion on the notion of a resource manager to shuttle context in and out of these limited slots.
On a Kabylake system, running the following command:
getcapability -cap 6 | grep trans
After booting into a TXT mediated measured launch environment (MLE) yields the following:
TPM_PT 0000010e value 00000003 TPM_PT_HR_TRANSIENT_MIN - the minimum number of transient objects that can be held in TPM RAM
TPM_PT 00000207 value 00000002 TPM_PT_HR_TRANSIENT_AVAIL - estimate of the number of additional transient objects that could be loaded into TPM RAM
Booting without TXT results in the getcapability call indicating that three slots are available. Based on that and reading the tboot code, we are assuming the occupied slot is the ephemeral primary key generated by tboot which seals the verification secret.
In an MLE it is possible to create and then flush a new ephemeral primary key which results in the following getcapability output:
TPM_PT 00000207 value 00000003 TPM_PT_HR_TRANSIENT_AVAIL - estimate of the number of additional transient objects that could be loaded into TPM RAM
Which is probably going to be pretty surprising to tboot in the event that it tries to re-verify the system state after a suspend event.
So based on that it would seem there would need to be some semblance of cooperation between the resource manager and an extra-OS utilization of TPM2 resources such as tboot.
Thoughts?
Quoted 1 line
/Jarkko
Greg
As always,
Dr. G.W. Wettstein, Ph.D. Enjellic Systems Development, LLC. 4206 N. 19th Ave. Specializing in information infra-structure Fargo, ND 58102 development.
PH: 701-281-1686
FAX: 701-281-3949 EMAIL: [email protected]
------------------------------------------------------------------------------
"For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled."
-- Richard Feynmann
Quoted 43 lines · Dr. Greg Wettstein
On Thu, Feb 16, 2017 at 10:33:04PM +0200, Jarkko Sakkinen wrote:
Good morning to everyone.
Quoted 11 lines · Dr. Greg Wettstein
Quoted 6 lines
Just as an aside, has anyone given any thought about TPM2 resource management in things like TXT/tboot environments? The current tboot code makes a rather naive assumption that it can take a handle slot to protect its platform verification secret. Doing resource management correctly will require addressing extra-OS environments such as this which may have TPM2 state requirement issues.
The current implementation handles stuff created from regular
/dev/tpm0so I do not think this would be an issue. You can only access objects from a TPM space that are created within that space.Unless I misunderstand the number of transient objects which can be managed is a characteristic of the hardware and is a limited resource, hence our discussion on the notion of a resource manager to shuttle context in and out of these limited slots.
On a Kabylake system, running the following command:
getcapability -cap 6 | grep trans
After booting into a TXT mediated measured launch environment (MLE) yields the following:
TPM_PT0000010evalue 00000003TPM_PT_HR_TRANSIENT_MIN- the minimum number of transient objects that can be held in TPM RAM
TPM_PT00000207 value 00000002TPM_PT_HR_TRANSIENT_AVAIL- estimate of the number of additional transient objects that could be loaded into TPM RAMBooting without TXT results in the getcapability call indicating that three slots are available. Based on that and reading the tboot code, we are assuming the occupied slot is the ephemeral primary key generated by tboot which seals the verification secret.
In an MLE it is possible to create and then flush a new ephemeral primary key which results in the following getcapability output:
TPM_PT00000207 value 00000003TPM_PT_HR_TRANSIENT_AVAIL- estimate of the number of additional transient objects that could be loaded into TPM RAM
Quoted 8 lines
Which is probably going to be pretty surprising to tboot in the event that it tries to re-verify the system state after a suspend event.
So based on that it would seem there would need to be some semblance of cooperation between the resource manager and an extra-OS utilization of TPM2 resources such as tboot.
Thoughts?
The driver swaps in and out all the objects for one send-receive cycle. So unless the driver is sending a command to a TPM the resource manager occupies zero slots. I do not see reason for forseeable future to change this pattern.
I discussed about some "lazier" schemes for swapping with James an Ken in the early Fall but came into conclusion that it would make the RM really complicated. There would have to be something show stopper work load to even to start consider it.
With the capacity of current TPMs and amount of traffic and workloads it is really not a worth of the trouble.
I guess the way we do swapping kind of indirectly sorts out the issue you described, doesn't it?
/Jarkko
On Fri, Feb 17, 2017 at 02:37:12PM +0200, Jarkko Sakkinen wrote:
Hi, I hope the week is ending well for everyone.
Quoted 63 lines · Dr. Greg Wettstein
Quoted 43 lines · Jarkko Sakkinen
Good morning to everyone.
Quoted 11 lines · Dr. Greg Wettstein
Quoted 6 lines
Just as an aside, has anyone given any thought about TPM2 resource management in things like TXT/tboot environments? The current tboot code makes a rather naive assumption that it can take a handle slot to protect its platform verification secret. Doing resource management correctly will require addressing extra-OS environments such as this which may have TPM2 state requirement issues.
The current implementation handles stuff created from regular
/dev/tpm0so I do not think this would be an issue. You can only access objects from a TPM space that are created within that space.Unless I misunderstand the number of transient objects which can be managed is a characteristic of the hardware and is a limited resource, hence our discussion on the notion of a resource manager to shuttle context in and out of these limited slots.
On a Kabylake system, running the following command:
getcapability -cap 6 | grep trans
After booting into a TXT mediated measured launch environment (MLE) yields the following:
TPM_PT0000010evalue 00000003TPM_PT_HR_TRANSIENT_MIN- the minimum number of transient objects that can be held in TPM RAM
TPM_PT00000207 value 00000002TPM_PT_HR_TRANSIENT_AVAIL- estimate of the number of additional transient objects that could be loaded into TPM RAMBooting without TXT results in the getcapability call indicating that three slots are available. Based on that and reading the tboot code, we are assuming the occupied slot is the ephemeral primary key generated by tboot which seals the verification secret.
In an MLE it is possible to create and then flush a new ephemeral primary key which results in the following getcapability output:
TPM_PT00000207 value 00000003TPM_PT_HR_TRANSIENT_AVAIL- estimate of the number of additional transient objects that could be loaded into TPM RAMQuoted 8 lines
Which is probably going to be pretty surprising to tboot in the event that it tries to re-verify the system state after a suspend event.
So based on that it would seem there would need to be some semblance of cooperation between the resource manager and an extra-OS utilization of TPM2 resources such as tboot.
Thoughts?
The driver swaps in and out all the objects for one send-receive cycle. So unless the driver is sending a command to a TPM the resource manager occupies zero slots. I do not see reason for forseeable future to change this pattern.
I discussed about some "lazier" schemes for swapping with James an Ken in the early Fall but came into conclusion that it would make the RM really complicated. There would have to be something show stopper work load to even to start consider it.
Quoted 5 lines
With the capacity of current TPMs and amount of traffic and workloads it is really not a worth of the trouble.
I guess the way we do swapping kind of indirectly sorts out the issue you described, doesn't it?
I'm not sure, we've pulled down your resource manager branch so we can figure out the exact mechanics of how it works. Based on a cursory read of the code it appears as if it loops through all three transient handle slots and attempts to context save each transient object it finds. So if it does that for each send/receive cycle it should theoretically inter-operate with TXT/tboot.
As noted previously, with the current kernel driver, we can see that tboot has allocated a slot for the ephemeral key which is used to seal the memory verification secrets. This key gets allocated to handle 80000000 as one would anticipate. However when we attempt to issue a context save against that handle we get an error.
Interestingly, when we attempt to flush that handle manually we receive an error as well, but the number of available transient handles increases by one which suggests the context flush cleared the slot.
It seems that we should be able to manually replicate what the resource manager is doing with the standard kernel driver or is this an incorrect assumption?
We will have to spin up a kernel with your patches and see how it reacts to the presence of the extra-OS handle allocation.
Quoted 1 line
/Jarkko
Greg
As always,
Dr. G.W. Wettstein, Ph.D. Enjellic Systems Development, LLC. 4206 N. 19th Ave. Specializing in information infra-structure Fargo, ND 58102 development.
PH: 701-281-1686
FAX: 701-281-3949 EMAIL: [email protected]
------------------------------------------------------------------------------
"We know that communication is a problem, but the company is not going
to discuss it with the employees."
-- Switching supervisor
AT&T Long Lines Division
Quoted 5 lines
Quoted 2 lines
quote: 810 milliseconds
verify signature: 635 millisecondsPart of the way of reducing the latency is not to use the TPM for things that don't require secrecy:
Agreed. There are a few times one would verify a signature inside the TPM,
but they're far from mainstream:
1 - Early in the boot cycle, when there's no crypto library.
2 - When the crypto library doesn't support the required algorithm.
3 - When a ticket is needed to prove to the TPM la
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel
Quoted 11 lines · James Bottomley
Quoted 4 lines · Dr. Greg Wettstein
On Feb 9, 11:24am, James Bottomley wrote:
quote: 810 milliseconds
verify signature: 635 milliseconds...
Part of the way of reducing the latency is not to use the TPM for things that don't require secrecy: container signature verification is one such because the container is signed with a private key to which
...
Agreed. There are a few times one would verify a signature inside the TPM, but they're far from mainstream:
1 - Early in the boot cycle, when there's no crypto library.
2 - When the crypto library doesn't support the required algorithm.
3 - When a ticket is needed to prove to the TPM later that it verified the signature.