Blame view

Documentation/intel_txt.txt 10.3 KB
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
1
2
  =====================
  Intel(R) TXT Overview
316253406   Joseph Cihula   x86, intel_txt: I...
3
4
5
6
7
8
9
10
11
  =====================
  
  Intel's technology for safer computing, Intel(R) Trusted Execution
  Technology (Intel(R) TXT), defines platform-level enhancements that
  provide the building blocks for creating trusted platforms.
  
  Intel TXT was formerly known by the code name LaGrande Technology (LT).
  
  Intel TXT in Brief:
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
12
13
14
15
  
  -  Provides dynamic root of trust for measurement (DRTM)
  -  Data protection in case of improper shutdown
  -  Measurement and verification of launched environment
316253406   Joseph Cihula   x86, intel_txt: I...
16
17
18
19
20
21
22
23
24
25
26
27
28
  
  Intel TXT is part of the vPro(TM) brand and is also available some
  non-vPro systems.  It is currently available on desktop systems
  based on the Q35, X38, Q45, and Q43 Express chipsets (e.g. Dell
  Optiplex 755, HP dc7800, etc.) and mobile systems based on the GM45,
  PM45, and GS45 Express chipsets.
  
  For more information, see http://www.intel.com/technology/security/.
  This site also has a link to the Intel TXT MLE Developers Manual,
  which has been updated for the new released platforms.
  
  Intel TXT has been presented at various events over the past few
  years, some of which are:
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
29
30
  
        - LinuxTAG 2008:
0ea6e6112   Justin P. Mattock   Documentation: up...
31
            http://www.linuxtag.org/2008/en/conf/events/vp-donnerstag.html
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
32
33
  
        - TRUST2008:
0ea6e6112   Justin P. Mattock   Documentation: up...
34
            http://www.trust-conference.eu/downloads/Keynote-Speakers/
316253406   Joseph Cihula   x86, intel_txt: I...
35
            3_David-Grawrock_The-Front-Door-of-Trusted-Computing.pdf
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
36
37
  
        - IDF, Shanghai:
0ea6e6112   Justin P. Mattock   Documentation: up...
38
            http://www.prcidf.com.cn/index_en.html
316253406   Joseph Cihula   x86, intel_txt: I...
39

7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
40
41
42
43
        - IDFs 2006, 2007
  	  (I'm not sure if/where they are online)
  
  Trusted Boot Project Overview
316253406   Joseph Cihula   x86, intel_txt: I...
44
  =============================
0ea6e6112   Justin P. Mattock   Documentation: up...
45
  Trusted Boot (tboot) is an open source, pre-kernel/VMM module that
316253406   Joseph Cihula   x86, intel_txt: I...
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
  uses Intel TXT to perform a measured and verified launch of an OS
  kernel/VMM.
  
  It is hosted on SourceForge at http://sourceforge.net/projects/tboot.
  The mercurial source repo is available at http://www.bughost.org/
  repos.hg/tboot.hg.
  
  Tboot currently supports launching Xen (open source VMM/hypervisor
  w/ TXT support since v3.2), and now Linux kernels.
  
  
  Value Proposition for Linux or "Why should you care?"
  =====================================================
  
  While there are many products and technologies that attempt to
  measure or protect the integrity of a running kernel, they all
  assume the kernel is "good" to begin with.  The Integrity
  Measurement Architecture (IMA) and Linux Integrity Module interface
  are examples of such solutions.
  
  To get trust in the initial kernel without using Intel TXT, a
  static root of trust must be used.  This bases trust in BIOS
  starting at system reset and requires measurement of all code
  executed between system reset through the completion of the kernel
  boot as well as data objects used by that code.  In the case of a
  Linux kernel, this means all of BIOS, any option ROMs, the
  bootloader and the boot config.  In practice, this is a lot of
  code/data, much of which is subject to change from boot to boot
  (e.g. changing NICs may change option ROMs).  Without reference
  hashes, these measurement changes are difficult to assess or
  confirm as benign.  This process also does not provide DMA
  protection, memory configuration/alias checks and locks, crash
  protection, or policy support.
  
  By using the hardware-based root of trust that Intel TXT provides,
  many of these issues can be mitigated.  Specifically: many
  pre-launch components can be removed from the trust chain, DMA
  protection is provided to all launched components, a large number
  of platform configuration checks are performed and values locked,
  protection is provided for any data in the event of an improper
  shutdown, and there is support for policy-based execution/verification.
  This provides a more stable measurement and a higher assurance of
  system configuration and initial state than would be otherwise
  possible.  Since the tboot project is open source, source code for
  almost all parts of the trust chain is available (excepting SMM and
  Intel-provided firmware).
  
  How Does it Work?
  =================
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
95
  -  Tboot is an executable that is launched by the bootloader as
316253406   Joseph Cihula   x86, intel_txt: I...
96
     the "kernel" (the binary the bootloader executes).
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
97
  -  It performs all of the work necessary to determine if the
316253406   Joseph Cihula   x86, intel_txt: I...
98
99
     platform supports Intel TXT and, if so, executes the GETSEC[SENTER]
     processor instruction that initiates the dynamic root of trust.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
100

316253406   Joseph Cihula   x86, intel_txt: I...
101
102
103
104
105
106
107
     -  If tboot determines that the system does not support Intel TXT
        or is not configured correctly (e.g. the SINIT AC Module was
        incorrect), it will directly launch the kernel with no changes
        to any state.
     -  Tboot will output various information about its progress to the
        terminal, serial port, and/or an in-memory log; the output
        locations can be configured with a command line switch.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
108
109
  
  -  The GETSEC[SENTER] instruction will return control to tboot and
316253406   Joseph Cihula   x86, intel_txt: I...
110
111
     tboot then verifies certain aspects of the environment (e.g. TPM NV
     lock, e820 table does not have invalid entries, etc.).
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
112
  -  It will wake the APs from the special sleep state the GETSEC[SENTER]
316253406   Joseph Cihula   x86, intel_txt: I...
113
114
     instruction had put them in and place them into a wait-for-SIPI
     state.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
115

316253406   Joseph Cihula   x86, intel_txt: I...
116
117
118
119
120
121
122
     -  Because the processors will not respond to an INIT or SIPI when
        in the TXT environment, it is necessary to create a small VT-x
        guest for the APs.  When they run in this guest, they will
        simply wait for the INIT-SIPI-SIPI sequence, which will cause
        VMEXITs, and then disable VT and jump to the SIPI vector.  This
        approach seemed like a better choice than having to insert
        special code into the kernel's MP wakeup sequence.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
123
124
  
  -  Tboot then applies an (optional) user-defined launch policy to
316253406   Joseph Cihula   x86, intel_txt: I...
125
     verify the kernel and initrd.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
126

316253406   Joseph Cihula   x86, intel_txt: I...
127
128
129
130
131
132
133
     -  This policy is rooted in TPM NV and is described in the tboot
        project.  The tboot project also contains code for tools to
        create and provision the policy.
     -  Policies are completely under user control and if not present
        then any kernel will be launched.
     -  Policy action is flexible and can include halting on failures
        or simply logging them and continuing.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
134
135
  
  -  Tboot adjusts the e820 table provided by the bootloader to reserve
316253406   Joseph Cihula   x86, intel_txt: I...
136
137
     its own location in memory as well as to reserve certain other
     TXT-related regions.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
138
  -  As part of its launch, tboot DMA protects all of RAM (using the
316253406   Joseph Cihula   x86, intel_txt: I...
139
140
141
     VT-d PMRs).  Thus, the kernel must be booted with 'intel_iommu=on'
     in order to remove this blanket protection and use VT-d's
     page-level protection.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
142
  -  Tboot will populate a shared page with some data about itself and
316253406   Joseph Cihula   x86, intel_txt: I...
143
     pass this to the Linux kernel as it transfers control.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
144

316253406   Joseph Cihula   x86, intel_txt: I...
145
146
     -  The location of the shared page is passed via the boot_params
        struct as a physical address.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
147
148
  
  -  The kernel will look for the tboot shared page address and, if it
316253406   Joseph Cihula   x86, intel_txt: I...
149
     exists, map it.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
150
  -  As one of the checks/protections provided by TXT, it makes a copy
316253406   Joseph Cihula   x86, intel_txt: I...
151
152
153
154
     of the VT-d DMARs in a DMA-protected region of memory and verifies
     them for correctness.  The VT-d code will detect if the kernel was
     launched with tboot and use this copy instead of the one in the
     ACPI table.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
155
  -  At this point, tboot and TXT are out of the picture until a
316253406   Joseph Cihula   x86, intel_txt: I...
156
     shutdown (S<n>)
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
157
  -  In order to put a system into any of the sleep states after a TXT
316253406   Joseph Cihula   x86, intel_txt: I...
158
159
160
     launch, TXT must first be exited.  This is to prevent attacks that
     attempt to crash the system to gain control on reboot and steal
     data left in memory.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
161

316253406   Joseph Cihula   x86, intel_txt: I...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
     -  The kernel will perform all of its sleep preparation and
        populate the shared page with the ACPI data needed to put the
        platform in the desired sleep state.
     -  Then the kernel jumps into tboot via the vector specified in the
        shared page.
     -  Tboot will clean up the environment and disable TXT, then use the
        kernel-provided ACPI information to actually place the platform
        into the desired sleep state.
     -  In the case of S3, tboot will also register itself as the resume
        vector.  This is necessary because it must re-establish the
        measured environment upon resume.  Once the TXT environment
        has been restored, it will restore the TPM PCRs and then
        transfer control back to the kernel's S3 resume vector.
        In order to preserve system integrity across S3, the kernel
4bd96a7a8   Shane Wang   x86, tboot: Add s...
176
177
178
179
180
181
182
183
184
        provides tboot with a set of memory ranges (RAM and RESERVED_KERN
        in the e820 table, but not any memory that BIOS might alter over
        the S3 transition) that tboot will calculate a MAC (message
        authentication code) over and then seal with the TPM. On resume
        and once the measured environment has been re-established, tboot
        will re-calculate the MAC and verify it against the sealed value.
        Tboot's policy determines what happens if the verification fails.
        Note that the c/s 194 of tboot which has the new MAC code supports
        this.
316253406   Joseph Cihula   x86, intel_txt: I...
185
186
  
  That's pretty much it for TXT support.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
187
  Configuring the System
316253406   Joseph Cihula   x86, intel_txt: I...
188
189
190
191
192
193
194
  ======================
  
  This code works with 32bit, 32bit PAE, and 64bit (x86_64) kernels.
  
  In BIOS, the user must enable:  TPM, TXT, VT-x, VT-d.  Not all BIOSes
  allow these to be individually enabled/disabled and the screens in
  which to find them are BIOS-specific.
7e18c07e7   Mauro Carvalho Chehab   intel_txt.txt: st...
195
  grub.conf needs to be modified as follows::
316253406   Joseph Cihula   x86, intel_txt: I...
196
197
198
199
200
201
202
203
204
205
          title Linux 2.6.29-tip w/ tboot
            root (hd0,0)
                  kernel /tboot.gz logging=serial,vga,memory
                  module /vmlinuz-2.6.29-tip intel_iommu=on ro
                         root=LABEL=/ rhgb console=ttyS0,115200 3
                  module /initrd-2.6.29-tip.img
                  module /Q35_SINIT_17.BIN
  
  The kernel option for enabling Intel TXT support is found under the
  Security top-level menu and is called "Enable Intel(R) Trusted
0335cb469   Kees Cook   Documentation: re...
206
  Execution Technology (TXT)".  It is considered EXPERIMENTAL and
316253406   Joseph Cihula   x86, intel_txt: I...
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
  depends on the generic x86 support (to allow maximum flexibility in
  kernel build options), since the tboot code will detect whether the
  platform actually supports Intel TXT and thus whether any of the
  kernel code is executed.
  
  The Q35_SINIT_17.BIN file is what Intel TXT refers to as an
  Authenticated Code Module.  It is specific to the chipset in the
  system and can also be found on the Trusted Boot site.  It is an
  (unencrypted) module signed by Intel that is used as part of the
  DRTM process to verify and configure the system.  It is signed
  because it operates at a higher privilege level in the system than
  any other macrocode and its correct operation is critical to the
  establishment of the DRTM.  The process for determining the correct
  SINIT ACM for a system is documented in the SINIT-guide.txt file
  that is on the tboot SourceForge site under the SINIT ACM downloads.