PageRenderTime 80ms CodeModel.GetById 46ms RepoModel.GetById 0ms app.codeStats 0ms

/Documentation/x86/intel_txt.rst

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