intel_txt.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. Intel(R) TXT Overview:
  2. =====================
  3. Intel's technology for safer computing, Intel(R) Trusted Execution
  4. Technology (Intel(R) TXT), defines platform-level enhancements that
  5. provide the building blocks for creating trusted platforms.
  6. Intel TXT was formerly known by the code name LaGrande Technology (LT).
  7. Intel TXT in Brief:
  8. o Provides dynamic root of trust for measurement (DRTM)
  9. o Data protection in case of improper shutdown
  10. o Measurement and verification of launched environment
  11. Intel TXT is part of the vPro(TM) brand and is also available some
  12. non-vPro systems. It is currently available on desktop systems
  13. based on the Q35, X38, Q45, and Q43 Express chipsets (e.g. Dell
  14. Optiplex 755, HP dc7800, etc.) and mobile systems based on the GM45,
  15. PM45, and GS45 Express chipsets.
  16. For more information, see http://www.intel.com/technology/security/.
  17. This site also has a link to the Intel TXT MLE Developers Manual,
  18. which has been updated for the new released platforms.
  19. Intel TXT has been presented at various events over the past few
  20. years, some of which are:
  21. LinuxTAG 2008:
  22. http://www.linuxtag.org/2008/en/conf/events/vp-donnerstag.html
  23. TRUST2008:
  24. http://www.trust-conference.eu/downloads/Keynote-Speakers/
  25. 3_David-Grawrock_The-Front-Door-of-Trusted-Computing.pdf
  26. IDF, Shanghai:
  27. http://www.prcidf.com.cn/index_en.html
  28. IDFs 2006, 2007 (I'm not sure if/where they are online)
  29. Trusted Boot Project Overview:
  30. =============================
  31. Trusted Boot (tboot) is an open source, pre-kernel/VMM module that
  32. uses Intel TXT to perform a measured and verified launch of an OS
  33. kernel/VMM.
  34. It is hosted on SourceForge at http://sourceforge.net/projects/tboot.
  35. The mercurial source repo is available at http://www.bughost.org/
  36. repos.hg/tboot.hg.
  37. Tboot currently supports launching Xen (open source VMM/hypervisor
  38. w/ TXT support since v3.2), and now Linux kernels.
  39. Value Proposition for Linux or "Why should you care?"
  40. =====================================================
  41. While there are many products and technologies that attempt to
  42. measure or protect the integrity of a running kernel, they all
  43. assume the kernel is "good" to begin with. The Integrity
  44. Measurement Architecture (IMA) and Linux Integrity Module interface
  45. are examples of such solutions.
  46. To get trust in the initial kernel without using Intel TXT, a
  47. static root of trust must be used. This bases trust in BIOS
  48. starting at system reset and requires measurement of all code
  49. executed between system reset through the completion of the kernel
  50. boot as well as data objects used by that code. In the case of a
  51. Linux kernel, this means all of BIOS, any option ROMs, the
  52. bootloader and the boot config. In practice, this is a lot of
  53. code/data, much of which is subject to change from boot to boot
  54. (e.g. changing NICs may change option ROMs). Without reference
  55. hashes, these measurement changes are difficult to assess or
  56. confirm as benign. This process also does not provide DMA
  57. protection, memory configuration/alias checks and locks, crash
  58. protection, or policy support.
  59. By using the hardware-based root of trust that Intel TXT provides,
  60. many of these issues can be mitigated. Specifically: many
  61. pre-launch components can be removed from the trust chain, DMA
  62. protection is provided to all launched components, a large number
  63. of platform configuration checks are performed and values locked,
  64. protection is provided for any data in the event of an improper
  65. shutdown, and there is support for policy-based execution/verification.
  66. This provides a more stable measurement and a higher assurance of
  67. system configuration and initial state than would be otherwise
  68. possible. Since the tboot project is open source, source code for
  69. almost all parts of the trust chain is available (excepting SMM and
  70. Intel-provided firmware).
  71. How Does it Work?
  72. =================
  73. o Tboot is an executable that is launched by the bootloader as
  74. the "kernel" (the binary the bootloader executes).
  75. o It performs all of the work necessary to determine if the
  76. platform supports Intel TXT and, if so, executes the GETSEC[SENTER]
  77. processor instruction that initiates the dynamic root of trust.
  78. - If tboot determines that the system does not support Intel TXT
  79. or is not configured correctly (e.g. the SINIT AC Module was
  80. incorrect), it will directly launch the kernel with no changes
  81. to any state.
  82. - Tboot will output various information about its progress to the
  83. terminal, serial port, and/or an in-memory log; the output
  84. locations can be configured with a command line switch.
  85. o The GETSEC[SENTER] instruction will return control to tboot and
  86. tboot then verifies certain aspects of the environment (e.g. TPM NV
  87. lock, e820 table does not have invalid entries, etc.).
  88. o It will wake the APs from the special sleep state the GETSEC[SENTER]
  89. instruction had put them in and place them into a wait-for-SIPI
  90. state.
  91. - Because the processors will not respond to an INIT or SIPI when
  92. in the TXT environment, it is necessary to create a small VT-x
  93. guest for the APs. When they run in this guest, they will
  94. simply wait for the INIT-SIPI-SIPI sequence, which will cause
  95. VMEXITs, and then disable VT and jump to the SIPI vector. This
  96. approach seemed like a better choice than having to insert
  97. special code into the kernel's MP wakeup sequence.
  98. o Tboot then applies an (optional) user-defined launch policy to
  99. verify the kernel and initrd.
  100. - This policy is rooted in TPM NV and is described in the tboot
  101. project. The tboot project also contains code for tools to
  102. create and provision the policy.
  103. - Policies are completely under user control and if not present
  104. then any kernel will be launched.
  105. - Policy action is flexible and can include halting on failures
  106. or simply logging them and continuing.
  107. o Tboot adjusts the e820 table provided by the bootloader to reserve
  108. its own location in memory as well as to reserve certain other
  109. TXT-related regions.
  110. o As part of its launch, tboot DMA protects all of RAM (using the
  111. VT-d PMRs). Thus, the kernel must be booted with 'intel_iommu=on'
  112. in order to remove this blanket protection and use VT-d's
  113. page-level protection.
  114. o Tboot will populate a shared page with some data about itself and
  115. pass this to the Linux kernel as it transfers control.
  116. - The location of the shared page is passed via the boot_params
  117. struct as a physical address.
  118. o The kernel will look for the tboot shared page address and, if it
  119. exists, map it.
  120. o As one of the checks/protections provided by TXT, it makes a copy
  121. of the VT-d DMARs in a DMA-protected region of memory and verifies
  122. them for correctness. The VT-d code will detect if the kernel was
  123. launched with tboot and use this copy instead of the one in the
  124. ACPI table.
  125. o At this point, tboot and TXT are out of the picture until a
  126. shutdown (S<n>)
  127. o In order to put a system into any of the sleep states after a TXT
  128. launch, TXT must first be exited. This is to prevent attacks that
  129. attempt to crash the system to gain control on reboot and steal
  130. data left in memory.
  131. - The kernel will perform all of its sleep preparation and
  132. populate the shared page with the ACPI data needed to put the
  133. platform in the desired sleep state.
  134. - Then the kernel jumps into tboot via the vector specified in the
  135. shared page.
  136. - Tboot will clean up the environment and disable TXT, then use the
  137. kernel-provided ACPI information to actually place the platform
  138. into the desired sleep state.
  139. - In the case of S3, tboot will also register itself as the resume
  140. vector. This is necessary because it must re-establish the
  141. measured environment upon resume. Once the TXT environment
  142. has been restored, it will restore the TPM PCRs and then
  143. transfer control back to the kernel's S3 resume vector.
  144. In order to preserve system integrity across S3, the kernel
  145. provides tboot with a set of memory ranges (RAM and RESERVED_KERN
  146. in the e820 table, but not any memory that BIOS might alter over
  147. the S3 transition) that tboot will calculate a MAC (message
  148. authentication code) over and then seal with the TPM. On resume
  149. and once the measured environment has been re-established, tboot
  150. will re-calculate the MAC and verify it against the sealed value.
  151. Tboot's policy determines what happens if the verification fails.
  152. Note that the c/s 194 of tboot which has the new MAC code supports
  153. this.
  154. That's pretty much it for TXT support.
  155. Configuring the System:
  156. ======================
  157. This code works with 32bit, 32bit PAE, and 64bit (x86_64) kernels.
  158. In BIOS, the user must enable: TPM, TXT, VT-x, VT-d. Not all BIOSes
  159. allow these to be individually enabled/disabled and the screens in
  160. which to find them are BIOS-specific.
  161. grub.conf needs to be modified as follows:
  162. title Linux 2.6.29-tip w/ tboot
  163. root (hd0,0)
  164. kernel /tboot.gz logging=serial,vga,memory
  165. module /vmlinuz-2.6.29-tip intel_iommu=on ro
  166. root=LABEL=/ rhgb console=ttyS0,115200 3
  167. module /initrd-2.6.29-tip.img
  168. module /Q35_SINIT_17.BIN
  169. The kernel option for enabling Intel TXT support is found under the
  170. Security top-level menu and is called "Enable Intel(R) Trusted
  171. Execution Technology (TXT)". It is considered EXPERIMENTAL and
  172. depends on the generic x86 support (to allow maximum flexibility in
  173. kernel build options), since the tboot code will detect whether the
  174. platform actually supports Intel TXT and thus whether any of the
  175. kernel code is executed.
  176. The Q35_SINIT_17.BIN file is what Intel TXT refers to as an
  177. Authenticated Code Module. It is specific to the chipset in the
  178. system and can also be found on the Trusted Boot site. It is an
  179. (unencrypted) module signed by Intel that is used as part of the
  180. DRTM process to verify and configure the system. It is signed
  181. because it operates at a higher privilege level in the system than
  182. any other macrocode and its correct operation is critical to the
  183. establishment of the DRTM. The process for determining the correct
  184. SINIT ACM for a system is documented in the SINIT-guide.txt file
  185. that is on the tboot SourceForge site under the SINIT ACM downloads.