This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xense-devel] RE: vTPM data seal issue

To: "Osborn, Justin D." <Justin.Osborn@xxxxxxxxxx>, <xense-devel@xxxxxxxxxxxxxxxxxxx>, <trousers-users@xxxxxxxxxxxxxxxxxxxxx>
Subject: [Xense-devel] RE: vTPM data seal issue
From: "Scarlata, Vincent R" <vincent.r.scarlata@xxxxxxxxx>
Date: Thu, 19 Oct 2006 17:00:56 -0700
Cc: mast@xxxxxxx
Delivery-date: Thu, 19 Oct 2006 17:15:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xense-devel-request@lists.xensource.com?subject=help>
List-id: "A discussion list for those developing security enhancements for Xen." <xense-devel.lists.xensource.com>
List-post: <mailto:xense-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xense-devel>, <mailto:xense-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xense-devel>, <mailto:xense-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xense-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcbzAwID5vKeu2XGQ5ul4MsJa+XckAA0wZGA
Thread-topic: vTPM data seal issue
I've CCed Mario Strasser. He is the author of the TPM emulator that is used for the vTPMs.
Thanks Justin, this I believe is a bug in the TPM emulator. If pcrInfoSize is zero, then the TPM protocols say to completely ignore the PCR_INFO structure and the next byte in this case should be inDataSize. The marshalling code always unpacks the PCR_INFO regardless of is pcrInfoSize == 0.
Mario, I have to think about it for a second, but I think everywhere you unmarshal PCR_INFO it should look something like
   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
           || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
           || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
           || (  pcrInfoSize > 0  ) && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo) )
           || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
           || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
           || len != 0) return TPM_BAD_PARAMETER;
-Vinnie Scarlata
 Trusted Platform Lab
 Corporate Technology Group
 Intel Corporation

From: Osborn, Justin D. [mailto:Justin.Osborn@xxxxxxxxxx]
Sent: Wednesday, October 18, 2006 3:16 PM
To: xense-devel@xxxxxxxxxxxxxxxxxxx; trousers-users@xxxxxxxxxxxxxxxxxxxxx; Scarlata, Vincent R
Subject: vTPM data seal issue

Hi everybody,
    For a while now I've been working on a project to do data sealing to TPM PCRs in a Xen Dom U using the vtpm.  I finally got everything set up, I'm using xen-unstable, the tpm_tis driver in Dom 0, and trousers 0.2.8 in Dom U (having patched Trousers with the TPM_PCR_INFO_LONG patch from Trusted Java that allows data sealing on Winbond/Infineon TPMs).
I booted my Dom U image, modprobe tpm_xenu, ran tcsd, and tpm_takeownership.  For the test I ran:
    ps auwx > foo
    tpm_sealdata < foo
This returns a TPM_BAD_PARAMETER.  However, executing:
    tpm_sealdata -p 1 < foo
works completely.
Further investigation in the vtpmd code revealed a block in tpm_cmd_handler.c that looks like:
     if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
           || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
           || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
           || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
           || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
           || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
           || len != 0) return TPM_BAD_PARAMETER;
vtpmd tries to unpackage everything regardless of pcrInfoSize.  So essentially what happens is, if not sealing to PCRs, trousers sends pcrInfoSize as 0, and then doesn't include the pcrInfo.  However, the vtpm is looking for the pcrInfo no matter what, and it tries to read past the end of the data.  It would appear that trousers is not breaking spec to do this because without vtpm data sealing works.  Perhaps the vtpm should unmarshal everything up to the pcrInfo and then check pcrInfoSize before trying to unmarshal pcrInfo?
For now I'm just always sealing to PCRs. :-)
Let me know if that makes sense.
P.S.  I'm completely new to TCG/TPM, so please excuse any naivete. 
Xense-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>
  • [Xense-devel] RE: vTPM data seal issue, Scarlata, Vincent R <=