Documentation/translations/zh_CN/security/tpm/tpm-security.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_CN/security/tpm/tpm-security.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_CN/security/tpm/tpm-security.rst- Extension
.rst- Size
- 9684 bytes
- Lines
- 152
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
.. SPDX-License-Identifier: GPL-2.0
.. include:: ../../disclaimer-zh_CN.rst
:Original: Documentation/security/tpm/tpm-security.rst
:翻译:
赵硕 Shuo Zhao <zhaoshuo@cqsoftware.com.cn>
TPM安全
=======
本文档的目的是描述我们如何使内核使用TPM在面对外部窥探和数据包篡改
攻击(文献中称为被动和主动中间人攻击)时保持合理的稳健性。当前的
安全文档适用于TPM2.0。
介绍
----
TPM通常是一个通过某种低带宽总线连接到PC的独立芯片。虽然有一些
例外,例如Intel PTT,它是运行在靠近CPU的软件环境中的软件TPM,
容易受到不同类型的攻击,但目前大多数强化的安全环境要求使用独立
硬件TPM,这是本文讨论的使用场景。
总线上的窥探和篡改攻击
----------------------
当前的技术状态允许使用 `TPM Genie`_ 硬件中间人,这是一种简单的外部设备,可以在
任何系统或笔记本电脑上几秒钟内安装。最近成功演示了针对 `Windows Bitlocker TPM`_
系统的攻击。最近同样的攻击针对 `基于TPM的Linux磁盘加密`_ 方案也遭到了同样的攻击。
下一阶段的研究似乎是入侵总线上现有的设备以充当中间人,因此攻击者需要物理访问几
秒钟的要求可能不再存在。然而,本文档的目标是尽可能在这种环境下保护TPM的机密性和
完整性,并尝试确保即使我们不能防止攻击,至少可以检测到它。
不幸的是,大多数TPM功能,包括硬件重置功能,都能被能够访问总线的攻击
者控制,因此下面我们将讨论一些可能出现的干扰情况。
测量(PCR)完整性
-----------------
由于攻击者可以向TPM发送自己的命令,他们可以发送任意的PCR扩展,从而破
坏测量系统,这将是一种烦人的拒绝服务攻击。然而,针对密封到信任测量中
的实体,有两类更严重的攻击。
1. 攻击者可以拦截来自系统的所有PCR扩展,并完全替换为自己的值,产生
一个未篡改状态的重现,这会使PCR测量证明状态是可信的,并释放密钥。
2. 攻击者可能会在某个时刻重置TPM,清除PCR,然后发送自己的测量,从而
有效地覆盖TPM已经完成的启动时间测量。
第一种攻击可以通过始终对PCR扩展和读取命令进行HMAC保护来防止,这意味着
如果没有在响应中产生可检测的HMAC失败,则测量值无法被替换。然而第二种
攻击只能通过依赖某种机制来检测,这种机制会在TPM重置后发生变化。
秘密保护
--------
某些进出TPM的信息,如密钥密封、私钥导入和随机数生成容易被拦截,而仅仅
使用HMAC保护无法防止这种情况。因此,对于这些类型的命令,我们必须使用
请求和响应加密来防止秘密信息的泄露。
与TPM建立初始信任
-----------------
为了从一开始就提供安全性,必须建立一个初始的共享或非对称秘密,并且该
秘钥必须对攻击者不可知。最明显的途径是使用背书和存储种子,这些可以用
来派生非对称密钥。然而,使用这些密钥很困难,因为将它们传递给内核的唯
一方法是通过命令行,这需要在启动系统中进行广泛的支持,而且无法保证任
何一个层次不会有任何形式的授权。
Linux内核选择的机制是从空种子使用标准的存储种子参数派生出主椭圆曲线
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.