Berger TPM PDF
Berger TPM PDF
Application
Application
Application
vTPM Instance … …
vTPM Instance
…
… … Proxy
Application
Application
Application
Application
…
vTPM Manager VM VM VM
Secure Co -
processor Driver
TPM Driver TPM Driver
…
VM VM VM Hypervisor
Server-side Client-side Client-side
TPM Driver TPM Driver TPM Driver
vTPM Instance
vTPM Instance
Hardware …
Request/Response Path Secure
TPM Coprocessor
stance number is assigned by the virtual TPM when the 4.2 The Root vTPM Instance
vTPM instance is created.
Our design was driven by the goal of having a virtual
Every VM must associate with a unique vTPM in- TPM implementation that can be run on an external co-
stance. The vTPM instance number is prepended on the processor card as well as executed as a process running
server side so that virtual machines cannot forge packets within a virtual machine. We designed the virtual TPM
and try to get access to a vTPM instance that is not asso- such that the interaction of applications with either im-
ciated with them. A command’s originating virtual ma- plementation would be the same. New commands and
chine can be determined from the unique interrupt num- APIs that we introduce should work the same for both
ber raised by each client-side driver. implementations. Considerations regarding reducing the
trusted computing base of the environment hosting the
Since a TPM holds unique persistent state with se- virtual TPM did not directly influence the design, al-
cret information such as keys, it is necessary that a vir- though the intention is to have a virtual machine that is
tual machine be associated with its virtual TPM instance dedicated exclusively to providing virtual TPM function-
throughout the lifetime of the virtual machine. To keep ality.
this association over time, we maintain a list of virtual- Further, modern hypervisors support advanced fea-
machine-to-virtual-TPM-instance associations. tures such as virtual machine hibernation and migration
Figure 1 shows our architecture where TPM function- from one physical platform to another. The straightfor-
ality for all VMs is provided by a virtual TPM running in ward approach to supporting such features is to hibernate
the management VM. TPM functionality for this VM is and migrate a virtual TPM instance along with its as-
provided by the hardware TPM, and is used in the same sociated virtual machine, thus preserving existing mea-
way as in a system without a hypervisor where the oper- surements and avoiding the complexity of remeasuring
ating system owns the hardware TPM. running software in a new environment and accounting
for the loss of measurements representing software that
A variation of this architecture is shown in Figure 2 was loaded but is no longer running. However, the virtual
where virtual TPM functionality is provided by an ex- TPM migration process must offer more security guaran-
ternal secure coprocessor card that provides maximum tees for the virtual TPM instance state than is usually pro-
security for sensitive data, such as private keys, through vided for an operating system image that is being trans-
a tamper-responsive environment. Here the first VM is ferred. The virtual TPM migration process must guaran-
the owner of this hardware and uses one virtual TPM tee that any vTPM instance state in transit is not subject
instance for its own purposes. All other instances are to modification, duplication, or other compromise.
reserved for usage by other virtual machines. A proxy This set of requirements led us to design a virtual
process forwards TPM messages between the server-side TPM as a TPM capable of spawning new vTPM child
driver and the external card. instances. Having an always available vTPM root in-
GetInstanceKey(Instance )
Recv : Key
Package virtual TPM
Instance state
UnlockInstance(Instance,
Migration Digest)
the vTPM manager, and other components on which the 5.1 Implementation for Xen
correct functioning of the virtual environment and the
Xen is a VMM for paravirtualized operating systems that
vTPM depends.
can also support full virtualization by exploiting emerg-
As previously mentioned, the certificate for a virtual
ing hardware support for virtualization. In Xen-speak,
TPM instance does not necessarily stand for the same
each virtual machine is referred to as a domain. Domain-
security guarantees as that of a hardware TPM. If a chal-
0 is the first instance of an OS that is started during sys-
lenger decides that the security guarantees of the virtual
tem boot. In Xen version 3.0, domain-0 owns and con-
TPM are not sufficient he can directly challenge the vir-
trols all hardware attached to the system. All other do-
tual machine owning the hardware TPM to verify the ba-
mains are user domains that receive access to the hard-
sic measurements including the one of the virtual TPM.
ware using frontend device drivers that connect to back-
Section 7.2 describes how certificates can be issued to
end device drivers in domain-0. Domain-0 effectively
mitigate this problem.
proxies access to hardware such as network cards or hard
drive partitions.
5 Implementation We have implemented the following components for
virtual TPM support under the Xen hypervisor:
In this section we present our implementation of virtual • Split device-driver pair for connecting domains to a
TPM support for the Xen hypervisor [27]. We expect that virtual TPM
an implementation for other virtualization environments
would be similar in the area of virtual TPM management, • Scripts to help connect virtual machines to virtual
but will differ in the particular management tools and TPM instances
device-driver structure.
We have implemented the two previously discussed • Virtual TPM management tools
solutions of a virtual TPM. One is a pure software so- • Virtual TPM-specific extensions to Xen’s manage-
lution targeted to run as a process in user space inside a ment tools (e.g., xend, xm)
dedicated virtual machine (Figure 1) and the other runs
on IBM’s PCI-X Cryptographic Coprocessor (PCIXCC) • Full TPM 1.2 implementation extended with our
card [15] (Figure 2). virtual TPM command set
We have extended the Xen hypervisor tools to sup- configuration errors, the final decision on which virtual
port virtual TPM devices. xm, the Xen Management TPM instance is given to a virtual machine is made in the
tool, parses the virtual machine configuration file and, hotplug scripts and depends on already existing entries in
if specified, recognizes that a virtual TPM instance must the associations table.
be associated with a virtual machine. xend, the Xen Dae-
mon, makes entries in the xenstore [22] directory that in-
kernel = “/boot/vmlinuz -2.6.12 -xen”
dicate in which domain the TPM backend is located. Us-
ing this information, the TPM frontend driver in the user ramdisk = “/boot/vmlinuz -2.6.12 -xen.img”
domain establishes a connection to the backend driver. memory = 256
During the connection phase, the backend driver triggers name = “ UserDomainWithTPM ”
the Linux hotplug daemon that then launches scripts for
vtpm = [‘backend=0, instance=1’]
connecting the virtual TPM instance to the domain.
Within our virtual TPM hotplug scripts, we need to
differentiate whether the virtual machine was just created Figure 5: Virtual Machine Configuration File with vTPM
or whether it resumed after suspension. In the former Option
case, we initialize the virtual TPM instance with a reset.
In the latter case, we restore the state of the TPM from We have implemented the Xen-specific frontend driver
the time when the virtual machine was suspended. Inside such that it plugs into the generic TPM device driver that
the scripts we also administer a table of virtual-machine- is already in the Linux kernel. Any application that wants
to-virtual-TPM-instance associations and create new vir- to use the TPM would communicate with it through the
tual TPM instances when no virtual TPM exists for a usual device, /dev/tpm0. The backend driver is a com-
started virtual machine. ponent that only exists in the virtualized environment.
Figure 5 shows an example of a virtual machine con- There we offer a new device, /dev/vtpm, through which
figuration file with the virtual TPM option enabled. The the virtual TPM implementation listens for requests.
attributes indicate in which domain the TPM backend Our driver pair implements devices that are connected
driver is located and which TPM instance is preferred to a Xen-specific bus for split device drivers, called xen-
to be associated with the virtual machine. To eliminate bus. The xenbus interacts with the drivers by invoking
tamper responsive
TPM TCB TPM chip, BIOS environment, signed vTPM VM, hypervisor
software
Platform-Binding physical (e.g., soldering) PCI-X bus logical (H/W TPM or BIOS)
BIOS or hypervisor
OS-Binding hypervisor hypervisor
(if VM-owned)
Support OS 1 n n
Cost in USD 1 > 1,000 0
in the virtual TPM with these measurements. This se- 7 Discussion and Future Work
quence of measurements is part of the setup process of
the vTPM instance (see Section 4.4). As the user vir- In section 3 we introduced the requirements that an ar-
tual machine continues to run, the IMA-enhanced kernel chitecture for enabling TPM support in a virtual environ-
in that virtual machine also extends a virtual PCR with ment must fulfill. So far we have presented solutions for
measurements of every application that is loaded. the first three items and described their implementations.
We will now revisit our initial requirements and compare
them against our implementation. We then discuss solu-
IMA attests to the integrity of both the vTPM TCB tions for the remaining items.
and the user virtual machine by returning PCR values
from both the hardware TPM and the virtual TPM. We
achieve this with our vTPM by projecting the lower 7.1 Requirements Revisited
PCRs of the hardware TPM (e.g., PCRs 0 through 8) to Unmodified TPM Usage Model We provide TPM
all virtual TPMs. This means that if a user VM reads support by emulating device functionality through a soft-
one of those PCRs, the vTPM facility actually fetches ware implementation. We designed and implemented an
the value from the hardware TPM. Extending hardware architecture for the Xen hypervisor that enables us to
PCRs from user VMs is therefore disabled since these connect each user domain to its own TPM instance. With
registers are logically owned by the management VM as our command set extensions we can create as many vir-
depicted in Figure 4. Upper PCRs are accessible by user tual TPM instances as needed. All existing TPM V 1.2
VMs as usual. commands are available to a user domain and the TPM
command format remains unchanged.
Therefore, we have the management VM extend the
lower PCRs with measurements of the vTPM TCB. We Strong Virtual Machine to Virtual TPM Association
have the user VM extend the upper PCRs with measure- We have shown a design that supports strong virtual ma-
ments of the user VM itself. IMA reports then com- chine to virtual TPM association. Components that en-
bine lower PCR values, higher PCR values, and the mea- force this need to be implemented in the backend driver
surement list from both the user VM and the manage- such that TPM packets can be routed to the appropriate
ment VM to provide a comprehensive view of the sys- domain. Also, a table of virtual machine to virtual TPM
tem. To relay the names of applications measured into instance must be maintained.
the hardware TPM, we implemented a small extension to We introduced new TPM commands for secure migra-
Integrity Measurement Architecture that retrieves this in- tion of TPM state between two virtual TPM implemen-
formation from the vTPM-hosting domain using the Re- tations. Our migration protocol guarantees TPM unique-
portEnvironment command. Other aspects of IMA were ness and prevents attacks on the TPM state information
left unmodified. such as alterations to or omission of pieces of state infor-
AIK
curity features can be enforced. It is important for virtual
TPM migration that the asymmetric storage key is only Virtualized environment
migrated into a trusted virtual TPM. A possible solution quote
for determining the trustworthiness of a destination TPM privacyCA sign
is to require a certificate of the destination TPM’s stor- Signing Key
AIK Signing/Identity Key
age key where the signature key is an externally certified
show
Attestation Identity Key (AIK). create
Strong Association of the Virtual TPM with the Un- TPM SRK EK Encryption Keys
derlying TCB Using an existing attestation architec-
ture for Linux, we showed how a strong association be- sign
tween a virtual TPM instance and the hardware root of EK Certificate for EK MSK Manufacturer’s Signing Key
AIK
AIK’ Signing/Identity Key to the secure coprocessor certificate and enables re-
mote parties to establish security properties for the
create virtual TPM runtime environment as described in
Section 5.2.
vTPM-n SRK EK’ Encryption Keys Starting with this manufacturer-provided EK certifi-
cate, all the previously described solutions for creat-
Virtualized environment ing certificate chains for virtual TPM instances can
quote be applied.
privacyCA sign
Signing Key
AIK Signing/Identity Key Depending on which solution for issuing certificates is
show chosen, the migration of a virtual TPM to another plat-
create
form can affect the validity of certified TPM keys. If, for
example, AIKs have been certified based on an EK that
TPM SRK EK Encryption Keys was previously tied to the hardware platform through a
chain, as we have shown in the first two solutions, the
sign
AIKs must be invalidated once the VM is resumed on
EK Certificate for EK MSK Manufacturer’s Signing Key
the target platform since the link to the old platform has
now been broken. Our third solution avoids this prob-
Figure 7: Certification of AIK’ using AIK lem, because it does not establish a firm link with the
VM-hosting platform.
What makes the realization of an architecture based
of trust into the certificate-signing process [21]. on certificate chains more difficult is that AIKs and cer-
tificates may be maintained by programs inside the op-
2. Our second solution, depicted in Figure 7, does not erating system. The TSS stack must be aware of migra-
use a certificate for a virtual EK’, but issues cer- tion and destroy AIKs once the OS resumes on the target
tificates for virtual TPM AIKs based on an AIK is- platform. After the AIKs have been recreated, they must
sued for the hardware TPM. The resulting certifi- be certified for usage on the new platform. Applications
cate chain ties the virtual TPM’s AIK’ to the AIK must also be made aware of the new certificates and re-
of the hardware TPM, and thus to the hosting sys- move old ones from memory.
tem. The advantage of this solution is that once an Another problem can be certificates that clients exam-
AIK has been issued for the hardware TPM, virtual ine while a VM is migrating to a new platform. Based on
TPM AIKs for guest VMs can also be quickly cer- the evaluation of the certificate, the client may treat the
tified. Through the chain, a link is established to peer system as trusted, although it is now running inside
the hardware-TPM platform. The disadvantage of a new environment. For practical purposes, a migrating
this solution is that it requires changes to the nor- partition should offer a subscription service for any party
mal procedure of acquiring an AIK certificate from interested in learning about migration. Notifications can
a certificate authority. be sent that inform subscribers that migration has hap-
pened and trigger a reestablishment of trust. We do not
3. A third solution relies on a local authority to issue
currently offer such a service.
the certificate for the virtual TPM instance’s EKs.
The benefit of this procedure compared to the pre- Another question that arises due to virtual machine mi-
vious ones is that the resulting virtual TPM’s EK gration is: When a virtual machine is migrated from one
certificate is not tied to the hardware platform, since system to another, should all virtual machine environ-
no certificate chain is established to credentials of ments’ measurements be recorded and a history be es-
the hardware TPM. A local EK certificate authority tablished? We feel the answer to this question is ”yes”,
can also be used for hardware TPMs if they are not but we have not yet explored efficient ways to support
equipped with a platform certificate, as is often the this capability.
case today. Beyond this, this third solution offers
the advantage over the second one of not changing
the procedure for acquiring certificates for AIKs.
Table 2 gives an overview of the properties of the first
4. A fourth solution is based on a secure coprocessor three of our proposed solutions. A decision about which
that replaces the hardware TPM used in the other method to implement for certifying EKs must weigh
solutions to provide a hardware root of trust. The the advantages and disadvantages of each solution. If a
strong connection between the virtual TPM and the hard- 8 Related Work
ware TPM is desired, then one of solution 1,2 or 4 should
be implemented. However, it will be necessary in this The Xen open-source repository [27] contains a lim-
case to invalidate the chained certificates and keys after ited virtual TPM implementation comprised of combined
migration in order to reestablish a chain to the new hard- contributions by Intel Corporation and the authors of this
ware root of trust. In that respect our second solution of- paper. Our contributions to Xen so far include the vir-
fers better support for a dynamic environment, since here tual TPM driver pair (front- and back-end drivers), hot-
only the AIKs of the virtualized environment need to be plug scripts, and changes to Xen’s management tools.
recreated and certified. The first solution would eventu- We kept this infrastructure modular so that different real-
ally have to place the EK’ certificate on a revocation list izations of virtual TPMs can work with it. The virtual
and create a new EK. TPM design and implementation presented in this pa-
per adds the following to what is currently available in
Xen: support for migrating a vTPM instance alongside
its associated virtual machine, support for attestation of
If a local certification process has already been estab- the complete vTPM environment along with the contents
lished to certify EKs for hardware TPMs, this or a similar of a virtual machine, and an entirely separate software
process can be applied to EKs of virtual TPMs as well. implementation of the TPM specification. In addition,
It would simplify an implementation for virtual TPM mi- the virtual TPM now in Xen is a partial implementation
gration with its VM since in this case there is no link to based on version 1.1 of the TPM specification, while we
the parent environment. Therefore migration would not have updated our virtual TPM to be a complete imple-
break any certificate chains. It can be regarded as the mentation of version 1.2.
least complicated solution, since neither side of the attes- Previous research in the area of trusted computing ex-
tation procedure would have to forget about credentials amined how data that is protected (sealed) by a hardware
that applied to the pre-migration environment. TPM can be moved to another platform. Kuehn et al. [17]
9 Conclusions We would like to thank our shepherd, Peter Chen, and the
anonymous reviewers for their valuable comments. We
We have designed and implemented a system that pro- also thank the Xen community for their feedback on the
vides trusted computing functionality to every virtual vTPM work.
machine on a virtualized hardware platform. We virtual-
ized the Trusted Platform Module by extending the stan- References
dard TPM command set to support vTPM lifecycle man-
[1] Fabrice Bellard. Qemu, a fast and portable dynamic translator. In
agement and enable trust establishment in the virtualized Proceedings of the USENIX 2005 Annual Technical Conference,
environment. We added support for secure vTPM mi- FREENIX Track, pages 41–46, 2005.
gration while maintaining a strong association between a [2] C. Clark, K. Fraser, S. Hand, J. G. Hansen, E. Jul, C. Limpach,
vTPM instance and its associated VM. I. Pratt, and A. Warfield. Live Migration of Virtual Machines. In
We uncovered the most important difficulties that arise Proceedings of the 2nd Symposium on Networked Systems Design
and Implementation (NSDI ’05), 2005.
when virtualizing the TPM. Whereas usually virtualiza-
[3] Common Criteria. Trusted Computing Group (TCG) Personal
tion of hardware devices can be achieved through soft- Computer (PC) Specific Trusted Building Block (TBB) Protec-
ware emulation, we have demonstrated that this is not tion Profile and TCG PC Specific TBB With Maintenance Pro-
sufficient in the case of the TPM. Certificates that may tection Profile, July 2004.
exist for hardware TPMs and vouch for strong security [4] B. Dragovic, K. Fraser, S. Hand, T. Harris, A. Ho, I. Pratt,
properties need to be issued for virtual TPM instances’ A. Warfield, P. Barham, and R. Neugebauer. Xen and the Art
of Virtualization. In Proceedings of the ACM Symposium on Op-
endorsement keys . These certificates can naturally not erating Systems Principles, October 2003.
represent the same properties for a virtual TPM process [5] R. Figueiredo, P. A. Dinda, and J. Fortes. Resource virtualization
running in user space. Trust chains that are usually renaissance. IEEE Computer, 38(5):28–31, 2005.
owned by a single OS now pass through a hierarchy of [6] K. Fraser, S. Hand, R. Neugebauer, I. Pratt, A. Warfield, and
virtual machines. Virtual TPM migration can create fur- M. Williamson. Safe Hardware Access with the Xen Virtual Ma-
ther problems if certificate chains that have been estab- chine Monitor. In Proceedings of the OASIS ASPLOS Workshop,
2004.
lished break or trust must be reestablished.
[7] Tal Garfinkel, Ben Pfaff, Jim Chow, Mendel Rosenblum, and
We virtualized the Trusted Platform Module by mak- Dan Boneh. Terra: a Virtual Machine-based Platform for Trusted
ing all low-level TPM 1.2 commands available to every Computing. In Proceedings of the Symposium on Operating Sys-
virtual machine. Applications that don’t handle certifi- tems Principles (SOSP), pages 193–206, 2003.