X86 Spectre Variants and Mitigations

本文详细探讨了X86处理器中Spectre变种漏洞的原理,包括它们如何利用微架构预测执行来获取敏感信息。同时,文章也深入介绍了针对这些漏洞的各种缓解策略,如软件补丁、硬件更新以及操作系统的调整,以保护系统免受潜在攻击。
摘要由CSDN通过智能技术生成
Recently, folks in my company suspect if Spectre mitigations are involved once they see a performance bug. So I make a simple summary of different X86 Spectre Variants, performance loss and workarounds. So they can have a general idea if Spectre might be involved or rule out the issue by suggesting the proper workaround to customer when necessory. Some of the kernel command line are for UEK series only, but most of them are compatible with
kernel.

Spectre V1 (Bounds Check Bypass)
can't toggle at runtime
No performance impact

Spectre V2 (Branch Target Injection)
There are two mitigations, Retpoline and IBRS.
Retpoline is the prefered and by default enabled mitigation for most X86 systems, 0%-5% performance loss.
IBRS is intel suggested mitigation for Skylake+ processor and enabled by default for Skylake+, performance 
loss is less than 20% in extreme case.

Dynamic switch:
/sys/kernel/debug/x86{retpoline_enabled,ibrs_enabled}

Kernel bootup parameter:
spectre_v2=
                        on   - unconditionally enable
                        off  - unconditionally disable
                        auto - kernel detects whether your CPU model is
                               vulnerable  (default)
                        retpoline         - replace indirect branches
                        retpoline,generic - google's original retpoline
                        retpoline,amd     - AMD-specific minimal thunk
                        ibrs              - Use IBRS (if microcode is available).

nospectre_v2
                        Euivalent to spectre_v2=off

spectre_v2_heuristics=
                        off             - disable all heuristics (see below)
                        skylake=off     - do not use IBRS if present on Skylake
                                        
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值