요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=====================
Intel(R) TXT Overview
=====================
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:
- Provides dynamic root of trust for measurement (DRTM)
- Data protection in case of improper shutdown
- Measurement and verification of launched environment
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:
- LinuxTAG 2008:
http://www.linuxtag.org/2008/en/conf/events/vp-donnerstag.html
- TRUST2008:
http://www.trust-conference.eu/downloads/Keynote-Speakers/
3_David-Grawrock_The-Front-Door-of-Trusted-Computing.pdf
- IDF, Shanghai:
http://www.prcidf.com.cn/index_en.html
- IDFs 2006, 2007
(I'm not sure if/where they are online)
Trusted Boot Project Overview
=============================
Trusted Boot (tboot) is an open source, pre-kernel/VMM module that
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?
=================
- Tboot is an executable that is launched by the bootloader as
the "kernel" (the binary the bootloader executes).
- It performs all of the work necessary to determine if the
platform supports Intel TXT and, if so, executes the GETSEC[SENTER]
processor instruction that initiates the dynamic root of trust.
- 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.
- The GETSEC[SENTER] instruction will return control to tboot and
tboot then verifies certain aspects of the environment (e.g. TPM NV
lock, e820 table does not have invalid entries, etc.).
- It will wake the APs from the special sleep state the GETSEC[SENTER]
instruction had put them in and place them into a wait-for-SIPI
state.
- 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.
- Tboot then applies an (optional) user-defined launch policy to
verify the kernel and initrd.
- 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.
- Tboot adjusts the e820 table provided by the bootloader to reserve
its own location in memory as well as to reserve certain other
TXT-related regions.
- As part of its launch, tboot DMA protects all of RAM (using the
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.
- Tboot will populate a shared page with some data about itself and
pass this to the Linux kernel as it transfers control.
- The location of the shared page is passed via the boot_params
struct as a physical address.
- The kernel will look for the tboot shared page address and, if it
exists, map it.
- As one of the checks/protections provided by TXT, it makes a copy
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.
- At this point, tboot and TXT are out of the picture until a
shutdown (S<n>)
- In order to put a system into any of the sleep states after a TXT
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.
- 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
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.
That's pretty much it for TXT support.
Configuring the System
======================
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.
grub.conf needs to be modified as follows::
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
Execution Technology (TXT)". It is considered EXPERIMENTAL and
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.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Intel TXT 개요와 공개 자료
1-42Intel Trusted Execution Technology(Intel(R) TXT)는 trusted platform을 만들기 위한 building block을 제공하는 platform-level enhancement입니다. 이전 code name은 LaGrande Technology(LT)였습니다.
Intel TXT의 핵심 기능은 다음과 같습니다.
- measurement를 위한 Dynamic Root of Trust(DRTM)를 제공합니다.
- improper shutdown이 발생했을 때 data를 보호합니다.
- launch된 environment를 measure하고 verify합니다.
Intel TXT는 vPro brand의 일부이며 일부 non-vPro system에도 제공됩니다. 문서 작성 시점 기준 desktop은 Q35, X38, Q45, Q43 Express chipset, 예를 들어 Dell Optiplex 755와 HP dc7800에서 사용할 수 있고 mobile은 GM45, PM45, GS45 Express chipset을 지원합니다.
추가 정보와 최신 Intel TXT MLE Developers Manual은 `http://www.intel.com/technology/security/`에서 확인합니다.
| event | 자료 |
|---|---|
| LinuxTAG 2008 | `http://www.linuxtag.org/2008/en/conf/events/vp-donnerstag.html` |
| TRUST2008 | `http://www.trust-conference.eu/downloads/Keynote-Speakers/3_David-Grawrock_The-Front-Door-of-Trusted-Computing.pdf` |
| IDF Shanghai | `http://www.prcidf.com.cn/index_en.html` |
| IDF 2006, 2007 | 원문 저자는 online 위치를 확신하지 못한다고 밝힙니다. |
Trusted Boot project
43-57Trusted Boot(tboot)은 Intel TXT로 OS kernel/VMM을 measured·verified launch하는 open-source pre-kernel/VMM module입니다.
project는 `http://sourceforge.net/projects/tboot`에 있고 Mercurial source repository는 `http://www.bughost.org/repos.hg/tboot.hg`에 있습니다.
tboot은 TXT를 v3.2부터 지원하는 open-source VMM/hypervisor Xen과 Linux kernel launch를 지원합니다.
static trust chain 대비 가치
58-93running kernel integrity를 measure하거나 보호하는 많은 기술은 initial kernel이 처음부터 정상이라고 가정합니다. Integrity Measurement Architecture(IMA)와 Linux Integrity Module interface가 그런 예입니다.
Intel TXT 없이 initial kernel을 trust하려면 static root of trust를 사용해야 합니다. system reset 시점의 BIOS부터 kernel boot 완료까지 실행되는 모든 code와 그 code가 사용하는 data object를 measure해야 합니다. Linux에서는 BIOS 전체, option ROM, boot loader, boot configuration이 포함됩니다.
이 trust chain은 code/data 양이 많고 NIC 교체로 option ROM이 바뀌는 것처럼 boot마다 달라질 수 있습니다. reference hash가 없으면 measurement 변화가 benign한지 판단하기 어렵습니다. 또한 static 과정은 DMA protection, memory configuration/alias check와 lock, crash protection, policy support를 제공하지 않습니다.
Intel TXT의 hardware-based root of trust는 pre-launch component 다수를 trust chain에서 제거하고 launch component 전체에 DMA protection을 제공합니다. platform configuration을 광범위하게 검사해 값을 lock하고 improper shutdown의 data를 보호하며 policy-based execution/verification을 지원합니다.
따라서 measurement가 더 stable하고 system configuration 및 initial state에 대한 assurance가 높아집니다. tboot은 open source이므로 SMM과 Intel-provided firmware를 제외한 trust-chain 거의 전부의 source를 확인할 수 있습니다.
GETSEC[SENTER] launch와 AP wakeup
94-125boot loader는 tboot executable을 `kernel`, 즉 loader가 실행할 binary로 launch합니다. tboot은 platform이 Intel TXT를 지원하는지 확인하고 지원하면 dynamic root of trust를 시작하는 `GETSEC[SENTER]` processor instruction을 실행합니다.
platform이 Intel TXT를 지원하지 않거나 SINIT AC Module 오류처럼 configuration이 잘못되면 tboot은 state를 바꾸지 않고 kernel을 직접 launch합니다.
tboot 진행 정보는 terminal, serial port, in-memory log 중 하나 이상으로 출력되며 command-line switch로 위치를 구성합니다. `GETSEC[SENTER]`가 tboot으로 return하면 TPM NV lock, invalid entry가 없는 e820 table 등 environment 요소를 검증합니다.
`GETSEC[SENTER]`가 special sleep state에 둔 AP를 깨워 wait-for-SIPI 상태로 전환합니다. TXT environment의 processor는 INIT 또는 SIPI에 응답하지 않으므로 AP용 작은 VT-x guest를 만듭니다.
AP는 guest 안에서 INIT-SIPI-SIPI sequence를 기다리고 각 event로 VMEXIT한 뒤 VT를 disable하고 SIPI vector로 jump합니다. 이는 kernel MP wakeup sequence에 special code를 넣는 것보다 나은 선택으로 판단됐습니다.
launch policy, e820, DMA와 shared page
126-156tboot은 optional user-defined launch policy로 kernel과 initrd를 verify합니다. policy는 TPM NV에 root를 두며 tboot project 문서에 정의됩니다. project에는 policy 생성과 provisioning tool code도 있습니다.
policy는 완전히 user control 아래 있고 없으면 어떤 kernel도 launch합니다. failure에서 halt하거나 log만 남기고 계속하는 등 action도 유연합니다.
tboot은 boot loader의 e820 table을 조정해 자신의 memory location과 TXT-related region을 reserve합니다. launch 과정에서 VT-d Protected Memory Region(PMR)을 사용해 RAM 전체를 DMA-protect합니다.
blanket DMA protection을 제거하고 VT-d page-level protection을 사용하려면 kernel을 `intel_iommu=on`으로 boot해야 합니다.
tboot은 자신에 관한 data를 shared page에 채워 control transfer 때 Linux kernel에 넘깁니다. physical address는 `boot_params` struct로 전달됩니다. kernel은 address가 있으면 shared page를 map합니다.
TXT check의 하나로 tboot은 VT-d DMAR copy를 DMA-protected memory에 만들고 correctness를 검증합니다. VT-d code는 tboot launch를 detect하면 ACPI table의 DMAR 대신 이 protected copy를 사용합니다.
TXT exit, S3 resume와 memory MAC
157-190이후 shutdown 또는 sleep state `S<n>`까지 tboot과 TXT는 관여하지 않습니다. TXT launch 뒤 sleep state로 들어가려면 먼저 TXT를 exit해야 합니다. crash를 유도해 reboot control을 얻고 memory에 남은 data를 훔치는 attack을 막기 위해서입니다.
kernel은 sleep 준비를 마치고 원하는 ACPI sleep state에 필요한 data를 shared page에 채운 뒤 그 page의 vector를 통해 tboot으로 jump합니다. tboot은 environment를 clean up하고 TXT를 disable한 다음 kernel이 제공한 ACPI information으로 platform을 sleep state에 넣습니다.
S3에서는 tboot 자신을 resume vector로 등록해야 합니다. resume 때 measured environment를 다시 세우고 TPM PCRs를 restore한 뒤 kernel의 S3 resume vector로 control을 돌려줍니다.
S3 전후 system integrity를 유지하기 위해 kernel은 e820의 RAM과 `RESERVED_KERN` range 중 BIOS가 transition 동안 바꿀 수 있는 memory를 제외한 range set을 tboot에 제공합니다. tboot은 range 전체의 MAC(message authentication code)을 계산해 TPM으로 seal합니다.
resume에서 measured environment를 복구한 뒤 MAC을 다시 계산해 sealed value와 비교합니다. verification failure의 action은 tboot policy가 정합니다. 원문은 새 MAC code가 있는 tboot changeset 194가 이를 지원한다고 명시합니다.
BIOS, grub와 SINIT ACM 구성
191-227이 code는 32-bit, 32-bit PAE, 64-bit(x86_64) kernel에서 동작합니다. BIOS에서 TPM, TXT, VT-x, VT-d를 enable해야 합니다. BIOS에 따라 각각을 따로 제어하지 못할 수 있고 menu 위치도 다릅니다.
`grub.conf` 구성 예시는 다음과 같습니다.
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
Intel TXT kernel option은 Security top-level menu의 `Enable Intel(R) Trusted Execution Technology (TXT)`입니다. EXPERIMENTAL이며 kernel build flexibility를 위해 generic x86 support에 의존합니다. tboot이 platform support를 detect하므로 해당 kernel code를 실제로 실행할지도 runtime에 결정됩니다.
`Q35_SINIT_17.BIN`은 Intel TXT의 Authenticated Code Module(ACM)이며 system chipset-specific합니다. Trusted Boot site에서 받을 수 있는 Intel-signed unencrypted module이고 DRTM 과정에서 system을 verify·configure합니다.
다른 microcode보다 높은 privilege level에서 실행되고 올바른 동작이 DRTM 수립에 결정적이므로 Intel signature가 필요합니다. system에 맞는 SINIT ACM 선택 절차는 tboot SourceForge의 SINIT ACM download 아래 `SINIT-guide.txt`에 있습니다.
요약과 해설
intel_txt.rst:1-227Intel TXT와 tboot은 `GETSEC[SENTER]`로 dynamic root of trust를 만들고 kernel/initrd를 policy에 따라 검증합니다. pre-launch component를 trust chain에서 줄이고 VT-d PMR, platform check, TPM-rooted policy로 initial state assurance를 높입니다.
kernel에는 `boot_params`의 shared page로 state를 전달하고, TXT launch 뒤 sleep에서는 tboot을 거쳐 environment를 종료합니다. S3 resume에서는 measured environment와 PCR을 복구하고 protected memory-range MAC을 검증합니다.