如何缓解 CentOS 6.9 上的 Spectre 变体 2?

如何缓解 CentOS 6.9 上的 Spectre 变体 2?

根据英特尔微码更新于 2018 年 3 月 12 日发布,旨在解决 Spectre/Meltdown,微代码与 CentOS 6 不兼容。

因此,运行 CentOS 6 的系统仍然容易受到 Spectre 变体 2 的影响,因为 CentOS 维护者将此补丁的责任委托给上游供应商(又名英特尔)。

我们已经安装了所有可用的操作系统更新,并且已成功针对 CentOS 6 系统上的 Spectre Variant 1 和 Meltdown 进行修补。

运行输出https://raw.githubusercontent.com/speed47/spectre-meltdown-checker/master/spectre-meltdown-checker.sh:

Spectre and Meltdown mitigation detection tool v0.35

Checking for vulnerabilities on current system
Kernel is Linux 2.6.32-696.23.1.el6.x86_64 #1 SMP Tue Mar 13 22:44:18 UTC 2018 x86_64
CPU is Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz

Hardware check
* Hardware support (CPU microcode) for mitigation techniques
  * Indirect Branch Restricted Speculation (IBRS)
    * SPEC_CTRL MSR is available:  NO
    * CPU indicates IBRS capability:  NO
  * Indirect Branch Prediction Barrier (IBPB)
    * PRED_CMD MSR is available:  NO
    * CPU indicates IBPB capability:  NO
  * Single Thread Indirect Branch Predictors (STIBP)
    * SPEC_CTRL MSR is available:  NO
    * CPU indicates STIBP capability:  NO
  * Enhanced IBRS (IBRS_ALL)
    * CPU indicates ARCH_CAPABILITIES MSR availability:  NO
    * ARCH_CAPABILITIES MSR advertises IBRS_ALL capability:  NO
  * CPU explicitly indicates not being vulnerable to Meltdown (RDCL_NO):  NO
  * CPU microcode is known to cause stability problems:  NO  (model 58 stepping 9 ucode 31)
* CPU vulnerability to the three speculative execution attacks variants
  * Vulnerable to Variant 1:  YES
  * Vulnerable to Variant 2:  YES
  * Vulnerable to Variant 3:  YES

CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
* Mitigated according to the /sys interface:  YES  (kernel confirms that the mitigation is active)
* Kernel has array_index_mask_nospec:  NO
* Kernel has the Red Hat/Ubuntu patch:  YES
> STATUS:  NOT VULNERABLE  (Mitigation: Load fences)

CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
* Mitigated according to the /sys interface:  NO  (kernel confirms your system is vulnerable)
* Mitigation 1
  * Kernel is compiled with IBRS/IBPB support:  YES
  * Currently enabled features
    * IBRS enabled for Kernel space:  NO
    * IBRS enabled for User space:  NO
    * IBPB enabled:  YES
* Mitigation 2
  * Kernel compiled with retpoline option:  YES
  * Kernel compiled with a retpoline-aware compiler:  UNKNOWN
> STATUS:  VULNERABLE  (Vulnerable: Retpoline with unsafe module(s))

CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
* Mitigated according to the /sys interface:  YES  (kernel confirms that the mitigation is active)
* Kernel supports Page Table Isolation (PTI):  YES
* PTI enabled and active:  YES
* Running as a Xen PV DomU:  NO
> STATUS:  NOT VULNERABLE  (Mitigation: PTI)

A false sense of security is worse than no security at all, see --disclaimer

这在运行 CentOS 6.9 的多个系统上是相同的。

我们如何针对 Spectre 变体 2 修补运行 CentOS 6 的系统?

答案1

说真的,你可以完全忽略英特尔下载中心的操作系统兼容性列表,至少对于微代码分发来说是这样。它绝对一文不值。

微码更新包与采用英特尔微码更新的所有内容兼容。那东西的 ABI 已经有十五年没有发生过相关变化了。

CentOS 6.9 中的内核是否会利用微码更新引入的新功能是另一回事,即使不这样做,也不会使其与微码更新不兼容。

就此而言,他们关于如何将微代码上传到处理器的说明也是完全错误的(内核永远无法处理基于文本的格式)。

假设您无法从 CentOS 的其他分支获取 intel 微码更新的 SRPM 并进行重建,您可以只安装旧版本,并将 RPM 安装的微码数据文件替换为 intel tarball 中的等效文件。 不要忘记重建 initramfs/initrd 并重新启动以尽早应用更新。

或者您可以等待,CentOS 最终将发布更新,其他人也会如此。大多数(全部?)发行版已经在其不稳定或 beta 测试分支中提供了这些更新,并且它们最终将迁移到稳定版本(时间取决于发行版)。

相关内容