From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 3/4] stubdom/grub: send kernel measurements to vTPM
Date: Tue, 27 Nov 2012 13:53:37 -0500 [thread overview]
Message-ID: <50B50C31.6090708@tycho.nsa.gov> (raw)
In-Reply-To: <50B50193.3070303@jhuapl.edu>
On 11/27/2012 01:08 PM, Matthew Fioravante wrote:
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> This allows a domU with an arbitrary kernel and initrd to take advantage
>> of the static root of trust provided by a vTPM.
> Do you have any documentation updates for how to use it? They could be added to the vtpm documentation if thats the most appropriate location.
Not much documentation is really needed - you just launch a domain with the
pv-grub kernel and a vTPM, and this patch will write the measurements of the
kernel, initrd, and command line to PCRs 4/5, similar to trusted grub on real
hardware.
> How exactly does this work? Is it intended for HVM domains whos stubdom is connected to a vtpm? I've never tried to use vtpm with HVMs yet, so I'd be very surprised if it just works. Does it work for PVM domains?
>
> I'm not terribly familiar with how grub in stubdom works.
This is PV only. The pv-grub stubdom is constructed similar to any other PV domain,
but the pv-grub kernel is specified instead of a normal Linux kernel. The pv-grub
kernel then loads a grub.conf from the guest's disk image and loads the Linux
kernel and initrd specified by the guest; this is more secure than pygrub which
does the loading in dom0, and more flexible than requiring the user to pick from
a list of pre-approved non-malicious kernels. If the pv-grub domain is created on
command by a measured domain builder/initrd combination, you can produce a static
chain of trust extending down to the hardware TPM without involving every UID 0
process in dom0.
[...]
>> + cmd.pcr = be32(4); // PCR #4 for kernel
>> + sha_compute(cmd.hash, dom->kernel_blob, dom->kernel_size);
>> +
>> + tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
>> +
>> + cmd.pcr = be32(5); // PCR #5 for cmdline
>> + sha_compute(cmd.hash, cmdline, strlen(cmdline));
>> + tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
>> +
>> + cmd.pcr = be32(5); // PCR #5 for initrd
>> + sha_compute(cmd.hash, dom->ramdisk_blob, dom->ramdisk_size);
>> + tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
>> +
>> + shutdown_tpmfront(tpm, 1);
>> +}
> Does this actually work? vtpm-stubdom will shut itself down when the frontend tpm disconnects. Is it really ok to connect and disconnect these devices at will?
Hmm, apparently this part may depend on the change from tpmback_req to
tpmback_req_any to avoid the shutdown on disconnect. That might not be
required (shutdown for reconfigure shouldn't start returning NULL for
requests) but I also haven't tested that it works without #4.
[...]
>> +++ b/stubdom/grub/sha1.c
[...]
> There also exists a sha1 routine in polarssl. You can just link in the polarssl sha1 object file without the entire library. This is what vtpm-stubdom and vtpmmgrdom do to get the crypto pieces they need. Checkout their makefiles for details.
> Is there any reason using polarssl would be sub-optimal?
No, I think rewriting this to use the polarssl functions would be useful; I
didn't notice the polarssl function was available when this patch was created.
--
Daniel De Graaf
National Security Agency
next prev parent reply other threads:[~2012-11-27 18:53 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 16:11 [PATCH RFC] stubdom: Change vTPM shared page ABI Daniel De Graaf
2012-11-20 16:16 ` Fioravante, Matthew E.
2012-11-20 18:24 ` [PATCH] drivers/tpm-xen: " Daniel De Graaf
2012-11-23 11:04 ` [PATCH RFC] stubdom: " Ian Campbell
2012-11-23 16:15 ` Daniel De Graaf
2012-11-23 16:30 ` Ian Campbell
2012-11-23 17:37 ` Samuel Thibault
2012-11-26 13:03 ` Fioravante, Matthew E.
2012-11-26 13:11 ` Fioravante, Matthew E.
2012-11-28 20:46 ` Konrad Rzeszutek Wilk
2012-11-28 22:22 ` Matthew Fioravante
2012-11-29 7:53 ` Ian Campbell
2012-11-30 16:11 ` Konrad Rzeszutek Wilk
2012-11-27 14:38 ` Matthew Fioravante
2012-11-27 15:14 ` [PATCH 0/4] stubdom/vtpm improvements Daniel De Graaf
2012-11-27 15:14 ` [PATCH 1/4] stubdom: Change vTPM shared page ABI Daniel De Graaf
2012-11-27 21:29 ` Matthew Fioravante
2012-11-27 22:08 ` Daniel De Graaf
2012-11-29 14:14 ` Matthew Fioravante
2012-12-07 21:25 ` Konrad Rzeszutek Wilk
2012-12-10 9:58 ` Ian Campbell
2012-12-10 15:03 ` Matthew Fioravante
2012-11-27 15:14 ` [PATCH 2/4] stubdom/vtpm: Add reconfiguration support Daniel De Graaf
2012-11-27 16:44 ` Samuel Thibault
2012-11-29 18:53 ` Matthew Fioravante
2012-11-29 19:28 ` Daniel De Graaf
2012-11-29 19:47 ` Matthew Fioravante
2012-11-29 21:37 ` Samuel Thibault
2012-11-30 9:59 ` Ian Campbell
2012-11-27 15:14 ` [PATCH 3/4] stubdom/grub: send kernel measurements to vTPM Daniel De Graaf
2012-11-27 16:41 ` Samuel Thibault
2012-11-27 18:08 ` Matthew Fioravante
2012-11-27 18:36 ` Samuel Thibault
2012-11-27 18:53 ` Daniel De Graaf [this message]
2012-11-27 15:14 ` [PATCH 4/4] stubdom/vtpm: Support multiple backends and locality Daniel De Graaf
2012-11-27 16:42 ` Samuel Thibault
2012-11-27 18:19 ` Matthew Fioravante
2012-11-27 19:02 ` Daniel De Graaf
2012-11-27 19:48 ` Matthew Fioravante
2012-11-27 20:04 ` Samuel Thibault
2012-11-27 20:11 ` Daniel De Graaf
2012-11-27 20:21 ` Matthew Fioravante
2012-11-27 20:30 ` Daniel De Graaf
2012-11-27 20:34 ` Matthew Fioravante
2012-11-27 20:40 ` Daniel De Graaf
2012-11-27 22:16 ` [PATCH] stubdom/vtpm: make state save operation atomic Daniel De Graaf
2012-11-29 18:07 ` Matthew Fioravante
2012-11-29 20:24 ` Daniel De Graaf
2012-11-29 20:48 ` Matthew Fioravante
2012-11-28 21:58 ` [PATCH 4/4] stubdom/vtpm: Support multiple backends and locality Samuel Thibault
2012-11-29 19:09 ` Matthew Fioravante
2012-11-29 19:20 ` Daniel De Graaf
2012-11-27 16:46 ` [PATCH 0/4] stubdom/vtpm improvements Samuel Thibault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50B50C31.6090708@tycho.nsa.gov \
--to=dgdegra@tycho.nsa.gov \
--cc=Ian.Campbell@citrix.com \
--cc=matthew.fioravante@jhuapl.edu \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.