← Documents Documentation/security/tpm/xen-tpmfront.rst GitHub 원문 ↗

Linux 6.18.37 · Security

Xen용 가상 TPM 인터페이스

Xen vTPM은 DomU마다 고유한 vtpm-stubdom을 제공하고, 시스템 전체에 하나뿐인 vtpmmgr-stubdom이 Keys·NVRAM·영속 상태를 Physical TPM에 연결해 보호합니다. xen-tpmfront부터 mini-os의 frontend/backend와 TPM TIS driver까지 이어지는 양방향 경로, 각 도메인의 수명과 대응 관계, Xen 4.3 libxl 설정 및 IMA 사용 시 built-in 빌드 조건을 함께 설명합니다.

Source pathDocumentation/security/tpm/xen-tpmfront.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

xen-tpmfront.rst:1-124

Xen vTPM은 DomU마다 고유한 vtpm-stubdom을 제공하고, 시스템 전체에 하나뿐인 vtpmmgr-stubdom이 Keys·NVRAM·영속 상태를 Physical TPM에 연결해 보호합니다. xen-tpmfront부터 mini-os의 frontend/backend와 TPM TIS driver까지 이어지는 양방향 경로, 각 도메인의 수명과 대응 관계, Xen 4.3 libxl 설정 및 IMA 사용 시 built-in 빌드 조건을 함께 설명합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 =============================
2 Virtual TPM interface for Xen
3 =============================
4
5 Authors: Matthew Fioravante (JHUAPL), Daniel De Graaf (NSA)
6
7 This document describes the virtual Trusted Platform Module (vTPM) subsystem for
8 Xen. The reader is assumed to have familiarity with building and installing Xen,
9 Linux, and a basic understanding of the TPM and vTPM concepts.
10
11 Introduction
12 ------------
13
14 The goal of this work is to provide a TPM functionality to a virtual guest
15 operating system (in Xen terms, a DomU). This allows programs to interact with
16 a TPM in a virtual system the same way they interact with a TPM on the physical
17 system. Each guest gets its own unique, emulated, software TPM. However, each
18 of the vTPM's secrets (Keys, NVRAM, etc) are managed by a vTPM Manager domain,
19 which seals the secrets to the Physical TPM. If the process of creating each of
20 these domains (manager, vTPM, and guest) is trusted, the vTPM subsystem extends
21 the chain of trust rooted in the hardware TPM to virtual machines in Xen. Each
22 major component of vTPM is implemented as a separate domain, providing secure
23 separation guaranteed by the hypervisor. The vTPM domains are implemented in
24 mini-os to reduce memory and processor overhead.
25
26 This mini-os vTPM subsystem was built on top of the previous vTPM work done by
27 IBM and Intel corporation.
28
29
30 Design Overview
31 ---------------
32
33 The architecture of vTPM is described below::
34
35 +------------------+
36 | Linux DomU | ...
37 | | ^ |
38 | v | |
39 | xen-tpmfront |
40 +------------------+
41 | ^
42 v |
43 +------------------+
44 | mini-os/tpmback |
45 | | ^ |
46 | v | |
47 | vtpm-stubdom | ...
48 | | ^ |
49 | v | |
50 | mini-os/tpmfront |
51 +------------------+
52 | ^
53 v |
54 +------------------+
55 | mini-os/tpmback |
56 | | ^ |
57 | v | |
58 | vtpmmgr-stubdom |
59 | | ^ |
60 | v | |
61 | mini-os/tpm_tis |
62 +------------------+
63 | ^
64 v |
65 +------------------+
66 | Hardware TPM |
67 +------------------+
68
69 * Linux DomU:
70 The Linux based guest that wants to use a vTPM. There may be
71 more than one of these.
72
73 * xen-tpmfront.ko:
74 Linux kernel virtual TPM frontend driver. This driver
75 provides vTPM access to a Linux-based DomU.
76
77 * mini-os/tpmback:
78 Mini-os TPM backend driver. The Linux frontend driver
79 connects to this backend driver to facilitate communications
80 between the Linux DomU and its vTPM. This driver is also
81 used by vtpmmgr-stubdom to communicate with vtpm-stubdom.
82
83 * vtpm-stubdom:
84 A mini-os stub domain that implements a vTPM. There is a
85 one to one mapping between running vtpm-stubdom instances and
86 logical vtpms on the system. The vTPM Platform Configuration
87 Registers (PCRs) are normally all initialized to zero.
88
89 * mini-os/tpmfront:
90 Mini-os TPM frontend driver. The vTPM mini-os domain
91 vtpm-stubdom uses this driver to communicate with
92 vtpmmgr-stubdom. This driver is also used in mini-os
93 domains such as pv-grub that talk to the vTPM domain.
94
95 * vtpmmgr-stubdom:
96 A mini-os domain that implements the vTPM manager. There is
97 only one vTPM manager and it should be running during the
98 entire lifetime of the machine. This domain regulates
99 access to the physical TPM on the system and secures the
100 persistent state of each vTPM.
101
102 * mini-os/tpm_tis:
103 Mini-os TPM version 1.2 TPM Interface Specification (TIS)
104 driver. This driver used by vtpmmgr-stubdom to talk directly to
105 the hardware TPM. Communication is facilitated by mapping
106 hardware memory pages into vtpmmgr-stubdom.
107
108 * Hardware TPM:
109 The physical TPM that is soldered onto the motherboard.
110
111
112 Integration With Xen
113 --------------------
114
115 Support for the vTPM driver was added in Xen using the libxl toolstack in Xen
116 4.3. See the Xen documentation (docs/misc/vtpm.txt) for details on setting up
117 the vTPM and vTPM Manager stub domains. Once the stub domains are running, a
118 vTPM device is set up in the same manner as a disk or network device in the
119 domain's configuration file.
120
121 In order to use features such as IMA that require a TPM to be loaded prior to
122 the initrd, the xen-tpmfront driver must be compiled in to the kernel. If not
123 using such features, the driver can be compiled as a module and will be loaded
124 as usual.
125

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

문서 범위와 전제 지식

1-10

이 문서는 Xen의 가상 신뢰 플랫폼 모듈(vTPM) 서브시스템을 설명한다. 저자는 JHUAPL의 Matthew Fioravante와 NSA의 Daniel De Graaf이다.

독자는 Xen과 Linux를 빌드하고 설치하는 방법에 익숙하며, TPM과 vTPM의 기본 개념을 이해하고 있다고 가정한다.

문서의 출발점
항목내용
대상Xen vTPM 서브시스템
플랫폼Xen과 Linux
선행 지식TPM 및 vTPM 기본 개념
저자Matthew Fioravante, Daniel De Graaf

다루는 시스템과 독자에게 요구되는 배경지식을 구분한다.

=============================
Virtual TPM interface for Xen
=============================

Authors: Matthew Fioravante (JHUAPL), Daniel De Graaf (NSA)

This document describes the virtual Trusted Platform Module (vTPM) subsystem for
Xen. The reader is assumed to have familiarity with building and installing Xen,
Linux, and a basic understanding of the TPM and vTPM concepts.

vTPM의 목표와 신뢰 사슬

11-29

이 작업의 목표는 Xen에서 DomU라고 부르는 가상 게스트 운영체제에 TPM 기능을 제공하는 것이다. 프로그램은 가상 시스템의 TPM을 물리 시스템의 TPM과 같은 방식으로 사용할 수 있다.

각 게스트는 서로 고유한 에뮬레이션 소프트웨어 TPM을 하나씩 받는다. 그러나 각 vTPM의 비밀 정보인 Keys, NVRAM 등은 vTPM Manager 도메인이 관리하며, 이 도메인은 비밀 정보를 Physical TPM에 seal한다.

Manager, vTPM, guest 도메인을 만드는 절차를 신뢰할 수 있다면 vTPM 서브시스템은 hardware TPM에 뿌리를 둔 신뢰 사슬을 Xen 가상 머신까지 확장한다. 주요 구성 요소는 각각 별도 도메인으로 구현되어 hypervisor가 보장하는 보안 격리를 얻는다.

vTPM 도메인은 메모리와 프로세서 오버헤드를 줄이기 위해 mini-os로 구현되었다. 이 mini-os vTPM 서브시스템은 IBM과 Intel Corporation이 앞서 수행한 vTPM 작업 위에 구축되었다.

하드웨어 신뢰의 확장
Hardware TPM에 신뢰의 뿌리 형성vTPM Manager가 Keys와 NVRAM 관리비밀 정보를 Physical TPM에 sealManager·vTPM·guest 생성 절차 신뢰각 도메인을 hypervisor로 격리DomU까지 신뢰 사슬 확장

물리 TPM의 신뢰를 격리된 Xen 도메인으로 전달하는 조건을 보여 준다.

vTPM 보안 모델
요소책임
Guest vTPM게스트별 고유 소프트웨어 TPM 제공
vTPM Manager각 vTPM의 Keys·NVRAM·영속 상태 보호
Physical TPM비밀 정보 sealing의 하드웨어 기반
Hypervisor주요 구성 요소 도메인 사이의 보안 격리

게스트별 자원과 시스템 공용 자원의 책임을 나눈다.

Introduction
------------

The goal of this work is to provide a TPM functionality to a virtual guest
operating system (in Xen terms, a DomU).  This allows programs to interact with
a TPM in a virtual system the same way they interact with a TPM on the physical
system.  Each guest gets its own unique, emulated, software TPM.  However, each
of the vTPM's secrets (Keys, NVRAM, etc) are managed by a vTPM Manager domain,
which seals the secrets to the Physical TPM.  If the process of creating each of
these domains (manager, vTPM, and guest) is trusted, the vTPM subsystem extends
the chain of trust rooted in the hardware TPM to virtual machines in Xen. Each
major component of vTPM is implemented as a separate domain, providing secure
separation guaranteed by the hypervisor. The vTPM domains are implemented in
mini-os to reduce memory and processor overhead.

This mini-os vTPM subsystem was built on top of the previous vTPM work done by
IBM and Intel corporation.

DomU에서 Hardware TPM까지의 구조

30-68

vTPM 요청은 Linux DomU의 `xen-tpmfront`에서 시작해 게스트 전용 `vtpm-stubdom`으로 전달되고, 이어서 시스템 공용 `vtpmmgr-stubdom`을 거쳐 Hardware TPM에 도달한다. 원문의 위아래 화살표는 이 경로가 요청과 응답을 모두 운반하는 양방향 통신임을 나타낸다.

첫 번째 `mini-os/tpmback`은 Linux frontend와 `vtpm-stubdom` 사이를 잇는다. `vtpm-stubdom` 안의 `mini-os/tpmfront`는 Manager 쪽 `mini-os/tpmback`에 연결되고, Manager의 `mini-os/tpm_tis`가 최종적으로 물리 TPM과 통신한다.

Xen vTPM 왕복 통신 경로
Linux DomUxen-tpmfrontmini-os/tpmbackvtpm-stubdommini-os/tpmfrontmini-os/tpmbackvtpmmgr-stubdommini-os/tpm_tisHardware TPM

원문의 ASCII 계층을 같은 순서의 구조화 도식으로 옮겼다. 각 단계 사이는 요청과 응답이 오간다.

도메인 경계별 연결
출발연결 계층도착
Linux DomUxen-tpmfront ↔ mini-os/tpmbackvtpm-stubdom
vtpm-stubdommini-os/tpmfront ↔ mini-os/tpmbackvtpmmgr-stubdom
vtpmmgr-stubdommini-os/tpm_tisHardware TPM

frontend와 backend가 어느 도메인 경계를 연결하는지 정리한다.

Design Overview
---------------

The architecture of vTPM is described below::

  +------------------+
  |    Linux DomU    | ...
  |       |  ^       |
  |       v  |       |
  |   xen-tpmfront   |
  +------------------+
          |  ^
          v  |
  +------------------+
  | mini-os/tpmback  |
  |       |  ^       |
  |       v  |       |
  |  vtpm-stubdom    | ...
  |       |  ^       |
  |       v  |       |
  | mini-os/tpmfront |
  +------------------+
          |  ^
          v  |
  +------------------+
  | mini-os/tpmback  |
  |       |  ^       |
  |       v  |       |
  | vtpmmgr-stubdom  |
  |       |  ^       |
  |       v  |       |
  | mini-os/tpm_tis  |
  +------------------+
          |  ^
          v  |
  +------------------+
  |   Hardware TPM   |
  +------------------+

게스트와 vTPM 도메인 구성 요소

69-88

Linux DomU는 vTPM을 사용하려는 Linux 기반 게스트이며 여러 개가 존재할 수 있다. `xen-tpmfront.ko`는 Linux 기반 DomU가 vTPM에 접근하도록 하는 Linux kernel 가상 TPM frontend driver다.

`mini-os/tpmback`은 mini-os TPM backend driver다. Linux frontend가 이 backend에 연결되어 Linux DomU와 해당 vTPM 사이의 통신을 중계한다. 같은 driver는 `vtpmmgr-stubdom`이 `vtpm-stubdom`과 통신할 때도 사용된다.

`vtpm-stubdom`은 vTPM을 구현하는 mini-os stub domain이다. 실행 중인 `vtpm-stubdom` 인스턴스와 시스템의 논리 vTPM 사이에는 일대일 대응 관계가 있다. vTPM Platform Configuration Registers(PCRs)는 일반적으로 모두 0으로 초기화된다.

게스트 측 구성 요소
구성 요소개수·관계역할
Linux DomU여러 개 가능vTPM을 사용하는 Linux 게스트
xen-tpmfront.koDomU kernel driverLinux에서 vTPM 접근 제공
mini-os/tpmback통신 경계마다 사용frontend와 vTPM 또는 Manager 사이 중계
vtpm-stubdom논리 vTPM과 1:1게스트별 vTPM 구현, PCRs를 보통 0으로 초기화

DomU 요청이 게스트별 논리 vTPM에 도착할 때까지의 역할을 구분한다.

게스트 요청 처리
Linux DomU 프로그램xen-tpmfront.komini-os/tpmback게스트 전용 vtpm-stubdomPCRs와 논리 vTPM 상태 처리

Linux 프로그램의 TPM 요청이 게스트 전용 vTPM 구현에 전달된다.

* Linux DomU:
               The Linux based guest that wants to use a vTPM. There may be
               more than one of these.

* xen-tpmfront.ko:
                    Linux kernel virtual TPM frontend driver. This driver
                    provides vTPM access to a Linux-based DomU.

* mini-os/tpmback:
                    Mini-os TPM backend driver. The Linux frontend driver
                    connects to this backend driver to facilitate communications
                    between the Linux DomU and its vTPM. This driver is also
                    used by vtpmmgr-stubdom to communicate with vtpm-stubdom.

* vtpm-stubdom:
                 A mini-os stub domain that implements a vTPM. There is a
                 one to one mapping between running vtpm-stubdom instances and
                 logical vtpms on the system. The vTPM Platform Configuration
                 Registers (PCRs) are normally all initialized to zero.

Manager와 물리 TPM 구성 요소

89-111

`mini-os/tpmfront`는 mini-os TPM frontend driver다. vTPM mini-os 도메인인 `vtpm-stubdom`이 이를 사용해 `vtpmmgr-stubdom`과 통신한다. 또한 `pv-grub`처럼 vTPM 도메인과 통신하는 다른 mini-os 도메인도 이 driver를 사용한다.

`vtpmmgr-stubdom`은 vTPM Manager를 구현하는 mini-os domain이다. vTPM Manager는 하나만 존재하며 시스템이 살아 있는 동안 내내 실행되어야 한다. 이 도메인은 시스템의 physical TPM 접근을 조절하고 각 vTPM의 persistent state를 보호한다.

`mini-os/tpm_tis`는 TPM 1.2 TPM Interface Specification(TIS)용 mini-os driver다. `vtpmmgr-stubdom`은 이 driver로 hardware TPM과 직접 통신하며, hardware memory pages를 Manager 도메인에 mapping해 통신한다. Hardware TPM은 motherboard에 납땜된 물리 TPM이다.

Manager 측 구성 요소
구성 요소수명·개수역할
mini-os/tpmfrontvTPM 및 pv-grub 등에서 사용Manager backend로 요청 전달
vtpmmgr-stubdom시스템 전체에 1개, 전체 수명 동안 실행물리 TPM 접근 조절과 vTPM 영속 상태 보호
mini-os/tpm_tisManager 내부 driverTPM 1.2 TIS로 Hardware TPM과 직접 통신
Hardware TPMmotherboard의 물리 장치vTPM 비밀과 상태 보호의 하드웨어 기반

시스템 공용 Manager와 물리 장치 사이의 책임 및 수명을 정리한다.

Manager의 물리 TPM 접근
vtpm-stubdom 또는 pv-grubmini-os/tpmfrontManager의 mini-os/tpmbackvtpmmgr-stubdommini-os/tpm_tisHardware memory pages mappingHardware TPM

게스트별 vTPM 상태를 시스템 공용 Manager가 물리 TPM에 연결한다.

* mini-os/tpmfront:
                     Mini-os TPM frontend driver. The vTPM mini-os domain
                     vtpm-stubdom uses this driver to communicate with
                     vtpmmgr-stubdom. This driver is also used in mini-os
                     domains such as pv-grub that talk to the vTPM domain.

* vtpmmgr-stubdom:
                    A mini-os domain that implements the vTPM manager. There is
                    only one vTPM manager and it should be running during the
                    entire lifetime of the machine.  This domain regulates
                    access to the physical TPM on the system and secures the
                    persistent state of each vTPM.

* mini-os/tpm_tis:
                    Mini-os TPM version 1.2 TPM Interface Specification (TIS)
                    driver. This driver used by vtpmmgr-stubdom to talk directly to
                    the hardware TPM. Communication is facilitated by mapping
                    hardware memory pages into vtpmmgr-stubdom.

* Hardware TPM:
                The physical TPM that is soldered onto the motherboard.

Xen 통합과 driver 빌드 방식

112-124

vTPM driver 지원은 Xen 4.3에서 libxl toolstack을 통해 Xen에 추가되었다. vTPM과 vTPM Manager stub domain을 설정하는 자세한 방법은 Xen 문서 `docs/misc/vtpm.txt`를 참조한다.

stub domain이 실행 중이면 도메인 configuration file에서 disk 또는 network device를 설정하는 것과 같은 방식으로 vTPM device를 설정한다.

TPM이 initrd보다 먼저 로드되어야 하는 IMA 같은 기능을 사용하려면 `xen-tpmfront` driver를 kernel에 built-in으로 컴파일해야 한다. 그런 기능을 사용하지 않으면 driver를 module로 컴파일해 일반적인 방식으로 로드할 수 있다.

xen-tpmfront 빌드 선택
사용 조건빌드 방식이유
IMA 등 TPM이 initrd보다 먼저 필요Kernel built-in초기 부팅 단계에서 driver 사용
조기 TPM 의존 기능을 사용하지 않음Module일반 module 로딩 절차 사용

TPM이 필요한 시점에 따라 built-in과 module을 선택한다.

Xen에 vTPM 연결
Xen 4.3 이상 libxl toolstack 준비vTPM Manager stub domain 실행게스트별 vTPM stub domain 실행domain configuration file에 vTPM device 추가IMA 사용 여부에 맞춰 xen-tpmfront 빌드DomU에서 vTPM 사용

stub domain 준비부터 DomU 사용까지의 통합 순서다.

Integration With Xen
--------------------

Support for the vTPM driver was added in Xen using the libxl toolstack in Xen
4.3.  See the Xen documentation (docs/misc/vtpm.txt) for details on setting up
the vTPM and vTPM Manager stub domains.  Once the stub domains are running, a
vTPM device is set up in the same manner as a disk or network device in the
domain's configuration file.

In order to use features such as IMA that require a TPM to be loaded prior to
the initrd, the xen-tpmfront driver must be compiled in to the kernel.  If not
using such features, the driver can be compiled as a module and will be loaded
as usual.