Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1580582 > unrolled thread
| Started by | "Dr. Greg Wettstein" <gw@idfusion.org> |
|---|---|
| First post | 2017-02-14 15:50 +0100 |
| Last post | 2017-02-17 23:40 +0100 |
| Articles | 7 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion "Dr. Greg Wettstein" <gw@idfusion.org> - 2017-02-14 15:50 +0100
Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-02-14 17:50 +0100
Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion "Dr. Greg Wettstein" <greg@enjellic.com> - 2017-02-16 21:10 +0100
Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-02-16 21:40 +0100
Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion "Dr. Greg Wettstein" <greg@enjellic.com> - 2017-02-17 11:00 +0100
Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-02-17 13:40 +0100
Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion "Dr. Greg Wettstein" <greg@enjellic.com> - 2017-02-17 23:40 +0100
| From | "Dr. Greg Wettstein" <gw@idfusion.org> |
|---|---|
| Date | 2017-02-14 15:50 +0100 |
| Subject | Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion |
| Message-ID | <taMAy-35w-15@gated-at.bofh.it> |
On Fri, Feb 10, 2017 at 04:13:05PM -0500, Kenneth Goldman wrote:
Good morning to everyone.
> James Bottomley <James.Bottomley@HansenPartnership.com> wrote on
> 02/10/2017 11:46:03 AM:
>
> > > 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.
> > 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.
>
> 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: greg@enjellic.com
------------------------------------------------------------------------------
"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
[toc] | [next] | [standalone]
| From | James Bottomley <James.Bottomley@HansenPartnership.com> |
|---|---|
| Date | 2017-02-14 17:50 +0100 |
| Subject | Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion |
| Message-ID | <taOsG-4e9-27@gated-at.bofh.it> |
| In reply to | #1580582 |
On Tue, 2017-02-14 at 08:38 -0600, Dr. Greg Wettstein wrote: > On Fri, Feb 10, 2017 at 04:13:05PM -0500, Kenneth Goldman wrote: > > Good morning to everyone. > > > James Bottomley <James.Bottomley@HansenPartnership.com> wrote on > > 02/10/2017 11:46:03 AM: > > > > > > 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. > > > > 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. > > > > 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 > 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: greg@enjellic.com > --------------------------------------------------------------------- > --------- > "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 >
[toc] | [prev] | [next] | [standalone]
| From | "Dr. Greg Wettstein" <greg@enjellic.com> |
|---|---|
| Date | 2017-02-16 21:10 +0100 |
| Message-ID | <tbAxl-2RL-61@gated-at.bofh.it> |
| In reply to | #1580582 |
On Thu, Feb 16, 2017 at 09:04:47AM -0500, Ken Goldman wrote:
Good morning to everyone, leveraging some time between planes.
> On 2/14/2017 9:38 AM, Dr. Greg Wettstein wrote:
> >
> >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.
>
> 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: greg@enjellic.com
------------------------------------------------------------------------------
"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
[toc] | [prev] | [next] | [standalone]
| From | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
|---|---|
| Date | 2017-02-16 21:40 +0100 |
| Subject | Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion |
| Message-ID | <tbB0m-31F-21@gated-at.bofh.it> |
| In reply to | #1582921 |
On Thu, Feb 16, 2017 at 02:06:42PM -0600, Dr. Greg Wettstein wrote: > 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
[toc] | [prev] | [next] | [standalone]
| From | "Dr. Greg Wettstein" <greg@enjellic.com> |
|---|---|
| Date | 2017-02-17 11:00 +0100 |
| Message-ID | <tbNux-2Ef-1@gated-at.bofh.it> |
| In reply to | #1582926 |
On Thu, Feb 16, 2017 at 10:33:04PM +0200, Jarkko Sakkinen wrote:
Good morning to everyone.
> On Thu, Feb 16, 2017 at 02:06:42PM -0600, Dr. Greg Wettstein wrote:
> > 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.
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?
> /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: greg@enjellic.com
------------------------------------------------------------------------------
"For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled."
-- Richard Feynmann
[toc] | [prev] | [next] | [standalone]
| From | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
|---|---|
| Date | 2017-02-17 13:40 +0100 |
| Subject | Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion |
| Message-ID | <tbPZn-4hF-1@gated-at.bofh.it> |
| In reply to | #1583253 |
On Fri, Feb 17, 2017 at 03:56:26AM -0600, Dr. Greg Wettstein wrote: > On Thu, Feb 16, 2017 at 10:33:04PM +0200, Jarkko Sakkinen wrote: > > Good morning to everyone. > > > On Thu, Feb 16, 2017 at 02:06:42PM -0600, Dr. Greg Wettstein wrote: > > > 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. > > 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? 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
[toc] | [prev] | [next] | [standalone]
| From | "Dr. Greg Wettstein" <greg@enjellic.com> |
|---|---|
| Date | 2017-02-17 23:40 +0100 |
| Message-ID | <tbZm1-1Sq-5@gated-at.bofh.it> |
| In reply to | #1583382 |
On Fri, Feb 17, 2017 at 02:37:12PM +0200, Jarkko Sakkinen wrote:
Hi, I hope the week is ending well for everyone.
> On Fri, Feb 17, 2017 at 03:56:26AM -0600, Dr. Greg Wettstein wrote:
> > On Thu, Feb 16, 2017 at 10:33:04PM +0200, Jarkko Sakkinen wrote:
> >
> > Good morning to everyone.
> >
> > > On Thu, Feb 16, 2017 at 02:06:42PM -0600, Dr. Greg Wettstein wrote:
> > > > 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.
> >
> > 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?
> 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?
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.
> /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: greg@enjellic.com
------------------------------------------------------------------------------
"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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web