All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 11/12] vTPM/TPM2: Bind group keys and sectors data on disk
@ 2014-12-14 12:09 Quan Xu
  2014-12-15 15:55 ` Daniel De Graaf
  0 siblings, 1 reply; 3+ messages in thread
From: Quan Xu @ 2014-12-14 12:09 UTC (permalink / raw)
  To: xen-devel; +Cc: samuel.thibault, dgdegra, Quan Xu, stefano.stabellini

Signed-off-by: Quan Xu <quan.xu@intel.com>
---
 stubdom/vtpmmgr/disk_write.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/stubdom/vtpmmgr/disk_write.c b/stubdom/vtpmmgr/disk_write.c
index 4c825c5..73018ef 100644
--- a/stubdom/vtpmmgr/disk_write.c
+++ b/stubdom/vtpmmgr/disk_write.c
@@ -83,12 +83,18 @@ static void generate_group_seals(struct mem_group *src, const struct mem_tpm_mgr
 	if (src->nr_seals > NR_SEALS_PER_GROUP)
 		abort();
 
-	for(i=0; i < src->nr_seals; i++) {
+	for (i=0; i < src->nr_seals; i++) {
 		struct disk_seal_entry *dst = &src->seal_bits.entry[i];
-		dst->pcr_selection = src->seals[i].pcr_selection;
-		memcpy(&dst->digest_release, &src->seals[i].digest_release, 20);
-		TPM_pcr_digest(&dst->digest_at_seal, dst->pcr_selection);
-		TPM_disk_seal(dst, &sblob, sizeof(sblob));
+
+        /*TPM 2.0 bind | TPM 1.x seal*/
+        if (hw_is_tpm2()) {
+            TPM2_disk_bind(dst, &sblob, sizeof(sblob));
+        } else {
+            dst->pcr_selection = src->seals[i].pcr_selection;
+            memcpy(&dst->digest_release, &src->seals[i].digest_release, 20);
+            TPM_pcr_digest(&dst->digest_at_seal, dst->pcr_selection);
+            TPM_disk_seal(dst, &sblob, sizeof(sblob));
+        }
 	}
 	src->seal_bits.nr_cfgs = native_be32(src->nr_seals);
 
@@ -246,11 +252,16 @@ static void disk_write_seal_list(struct mem_tpm_mgr *mgr, struct mem_group *grou
 	for(i=0; i < group->nr_seals; i++) {
 		struct mem_seal *src = &group->seals[i];
 		struct disk_seal_entry *dst = &seal->entry[i];
-		dst->pcr_selection = src->pcr_selection;
-		memcpy(&dst->digest_release, &src->digest_release, 20);
-		TPM_pcr_digest(&dst->digest_at_seal, dst->pcr_selection);
 
-		TPM_disk_seal(dst, &sblob, sizeof(sblob));
+        /*TPM 2.0 bind / TPM 1.x seal*/
+        if (hw_is_tpm2()) {
+            TPM2_disk_bind(dst, &sblob, sizeof(sblob));
+        } else {
+            dst->pcr_selection = src->pcr_selection;
+            memcpy(&dst->digest_release, &src->digest_release, 20);
+            TPM_pcr_digest(&dst->digest_at_seal, dst->pcr_selection);
+            TPM_disk_seal(dst, &sblob, sizeof(sblob));
+        }
 	}
 
 	memcpy(seal->hdr.magic, TPM_MGR_MAGIC, 12);
-- 
1.8.3.2

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

* Re: [PATCH 11/12] vTPM/TPM2: Bind group keys and sectors data on disk
  2014-12-14 12:09 [PATCH 11/12] vTPM/TPM2: Bind group keys and sectors data on disk Quan Xu
@ 2014-12-15 15:55 ` Daniel De Graaf
  2014-12-16  2:14   ` Xu, Quan
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel De Graaf @ 2014-12-15 15:55 UTC (permalink / raw)
  To: Quan Xu, xen-devel; +Cc: samuel.thibault, stefano.stabellini

On 12/14/2014 07:09 AM, Quan Xu wrote:
[...]
> +        /*TPM 2.0 bind | TPM 1.x seal*/
> +        if (hw_is_tpm2()) {
> +            TPM2_disk_bind(dst, &sblob, sizeof(sblob));
> +        } else {
> +            dst->pcr_selection = src->seals[i].pcr_selection;
> +            memcpy(&dst->digest_release, &src->seals[i].digest_release, 20);
> +            TPM_pcr_digest(&dst->digest_at_seal, dst->pcr_selection);
> +            TPM_disk_seal(dst, &sblob, sizeof(sblob));
> +        }

It appears that the secrets for the vTPMs are only being bound to the
presence of the physical TPM and not the measurements of the hypervisor
and other TCB components.  This does not provide as much security as it
did for TPM 1.2: an attacker with access to the boot disk can boot into
a compromised environment and extract the vTPM keys and disk images.

The TPM2_Create/TPM2_Unseal operations should be capable of performing
the same functionality.  If only SHA1 PCRs are used, they should be able
to be drop-in replacements, but supporting other hash algorithms may be
a feature that users who have a TPM2 will want.

-- 
Daniel De Graaf
National Security Agency

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

* Re: [PATCH 11/12] vTPM/TPM2: Bind group keys and sectors data on disk
  2014-12-15 15:55 ` Daniel De Graaf
@ 2014-12-16  2:14   ` Xu, Quan
  0 siblings, 0 replies; 3+ messages in thread
From: Xu, Quan @ 2014-12-16  2:14 UTC (permalink / raw)
  To: Daniel De Graaf, xen-devel@lists.xen.org
  Cc: samuel.thibault@ens-lyon.org, stefano.stabellini@eu.citrix.com



> -----Original Message-----
> From: Daniel De Graaf [mailto:dgdegra@tycho.nsa.gov]
> Sent: Monday, December 15, 2014 11:56 PM
> To: Xu, Quan; xen-devel@lists.xen.org
> Cc: stefano.stabellini@eu.citrix.com; samuel.thibault@ens-lyon.org
> Subject: Re: [PATCH 11/12] vTPM/TPM2: Bind group keys and sectors data
> on disk
> 
> On 12/14/2014 07:09 AM, Quan Xu wrote:
> [...]
> > +        /*TPM 2.0 bind | TPM 1.x seal*/
> > +        if (hw_is_tpm2()) {
> > +            TPM2_disk_bind(dst, &sblob, sizeof(sblob));
> > +        } else {
> > +            dst->pcr_selection = src->seals[i].pcr_selection;
> > +            memcpy(&dst->digest_release, &src->seals[i].digest_release,
> 20);
> > +            TPM_pcr_digest(&dst->digest_at_seal, dst->pcr_selection);
> > +            TPM_disk_seal(dst, &sblob, sizeof(sblob));
> > +        }
> 
> It appears that the secrets for the vTPMs are only being bound to the
> presence of the physical TPM and not the measurements of the hypervisor
> and other TCB components.  This does not provide as much security as it
> did for TPM 1.2: an attacker with access to the boot disk can boot into a
> compromised environment and extract the vTPM keys and disk images.
> 
Agree with it.
I will bind more information, such as measurements of the hypervisor and other TCB components
In next version.


> The TPM2_Create/TPM2_Unseal operations should be capable of performing
> the same functionality.  If only SHA1 PCRs are used, they should be able to
> be drop-in replacements, but supporting other hash algorithms may be a
> feature that users who have a TPM2 will want.
> 
Interesting:)..
I will continue to develop and maintain vTPM on TPM 2.0. Make it stable and robust.

> --
> Daniel De Graaf
> National Security Agency


Intel
Quan Xu

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

end of thread, other threads:[~2014-12-16  2:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-14 12:09 [PATCH 11/12] vTPM/TPM2: Bind group keys and sectors data on disk Quan Xu
2014-12-15 15:55 ` Daniel De Graaf
2014-12-16  2:14   ` Xu, Quan

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.