Name
Branch Target Injection
Also known as
Spectre variant 2, Variant 2
Vulnerability
Spectre variant 2
Kind
Transient execution
CVE published
2018-01-04 CVE record
Advisories
INTEL-SA-00088
Linux reports it in
spectre_v2

The branch target buffer that predicts indirect branches is indexed by only part of a branch’s address, so a branch in the attacker’s code can share an entry with a branch in the victim’s. The attacker jumps to a chosen target from such an alias, then enters the victim, whose indirect branch speculatively runs that target: a gadget that loads secret data and leaves a trace of it in the cache. On processors with simultaneous multithreading, the sibling thread can train the shared predictor too.

Linux reports variant 2 on every processor that speculates, except where it lists the processor as not affected: the Zhaoxin and Centaur family 7 parts, and the Bonnell and Saltwell Atoms.

Affected processors

59 of the 63 microarchitectures listed are affected in all or some of their models.

What the sources say of each microarchitecture. Intel’s list gives each CPUID family, model and stepping it covers, with Intel’s mitigation for it (Software, MCU for a microcode update, or Hardware).
MicroarchitectureStatusDetailSource
NetBurst (Prescott, Nocona)AffectedLinux 7.3 sets the bug on INTEL_P4_CEDARMILL, INTEL_P4_PRESCOTT, INTEL_P4_PRESCOTT_2M: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Core (Merom, Conroe)AffectedLinux 7.3 sets the bug on INTEL_CORE2_MEROM, INTEL_CORE2_MEROM_L: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
PenrynAffectedLinux 7.3 sets the bug on INTEL_CORE2_DUNNINGTON, INTEL_CORE2_PENRYN: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
NehalemAffectedLinux 7.3 sets the bug on INTEL_NEHALEM, INTEL_NEHALEM_EP, INTEL_NEHALEM_EX, INTEL_NEHALEM_G: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
WestmereAffectedLinux 7.3 sets the bug on INTEL_WESTMERE, INTEL_WESTMERE_EP, INTEL_WESTMERE_EX: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Sandy BridgeAffectedLinux 7.3 sets the bug on INTEL_SANDYBRIDGE, INTEL_SANDYBRIDGE_X: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Ivy BridgeAffectedLinux 7.3 sets the bug on INTEL_IVYBRIDGE, INTEL_IVYBRIDGE_X: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
HaswellAffected06_3FH stepping 2 (Haswell Server EP/EP4S): MCU+Software
06_3FH stepping 4 (Haswell Server EX): MCU+Software
Intel’s list
BroadwellAffected06_4FH stepping 1 (1. Broadwell Server E/EP/EP4S - 2. Broadwell Server EX): MCU+Software
06_56H stepping 3 (Broadwell DE V2 - V3): MCU+Software
06_56H stepping 4 (Broadwell DE Y0): MCU+Software
06_56H stepping 5 (Hewitt Lake (Broadwell DE)): MCU+Software
Intel’s list
SkylakeAffected06_5EH stepping 3 (1. Skylake Xeon E3 - 2. Skylake H - 3. Skylake S): MCU+SoftwareIntel’s list
Kaby LakeAffected06_8EH stepping 9 (1. Amber Lake-Y - 2. Kaby Lake U - 3. Kaby Lake U23e - 4. Kaby Lake Y): MCU+Software
06_8EH stepping C (1. Whiskey Lake V - 2. Comet Lake U42 - 3. Amber Lake Y): Hardware+Software
06_9EH stepping 9 (1. Kaby Lake S - 2. Kaby Lake Xeon E3): MCU+Software
Intel’s list
Coffee LakeAffected06_8EH stepping A (1. Coffee Lake U43e - 2. Whiskey Lake): MCU+Software
06_8EH stepping B (Whiskey Lake U): MCU+Software
06_8EH stepping C (1. Whiskey Lake V - 2. Comet Lake U42 - 3. Amber Lake Y): Hardware+Software
06_9EH stepping A (Coffee Lake H): MCU+Software
06_9EH stepping C (Coffee Lake S): MCU+Software
06_9EH stepping D (1. Coffee Lake H - 2. Coffee Lake Xeon E - 3. Coffee Lake S): Hardware+Software
Intel’s list
Cannon LakeAffectedLinux 7.3 sets the bug on INTEL_CANNONLAKE_L: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Comet LakeAffected06_8EH stepping C (1. Whiskey Lake V - 2. Comet Lake U42 - 3. Amber Lake Y): Hardware+Software
06_A5H stepping 2 (Comet Lake H): Hardware+Software
06_A5H stepping 3 (Comet Lake-S): Hardware+Software
06_A5H stepping 5 (Comet Lake-S): Hardware+Software
06_A6H stepping 0 (Comet Lake U62): Hardware+Software
06_A6H stepping 1 (Comet Lake U62): Hardware+Software
Intel’s list
Ice Lake (client)Affected06_7EH stepping 5 (Ice Lake U - Ice Lake Y): Hardware+SoftwareIntel’s list
Tiger LakeAffected06_8CH stepping 1 (Tiger Lake U): Hardware+Software
06_8CH stepping 1 (Tiger Lake U): Hardware+Software
06_8CH stepping 2 (1. Tiger Lake U Refresh - 2. Tiger Lake H35): Hardware+Software
06_8DH stepping 1 (Tiger Lake H): Hardware+Software
06_8DH stepping 1 (Tiger Lake H): Hardware+Software
Intel’s list
Alder LakeAffected06_97H stepping 2 (Alder Lake S (Golden Cove - Gracemont)): Hardware+Software
06_97H stepping 5 (Alder Lake S (Golden Cove - Gracemont)): Hardware+Software
06_97H stepping 5 (Catlow (Golden Cove)): Hardware+Software
06_9AH stepping 3 (1. Alder Lake H (Golden Cove - Gracemont) - 2. Alder Lake P (Golden Cove - Gracemont)): Hardware+Software
06_9AH stepping 4 (Alder Lake U (Golden Cove - Gracemont)): Hardware+Software
Intel’s list
Rocket LakeAffected06_A7H stepping 1 (Rocket Lake): Hardware+SoftwareIntel’s list
Raptor LakeAffected06_B7H stepping 1 (1. Raptor Lake S - 2. Raptor Lake HX (Raptor Cove/Gracemont)): Hardware+Software
06_B7H stepping 1 (Catlow (Raptor Cove)): Hardware+Software
06_BAH stepping 2 - 3 - 8 (1. Raptor Lake P - 2. Raptor Lake H + refresh - 3. Raptor Lake U + refresh (Raptor Cove/Gracemont)): Hardware+Software
06_BFH stepping 2 - 5 (Raptor Lake S (Raptor Cove/Gracemont)): Hardware+Software
Intel’s list
Meteor LakeAffected06_AAH stepping 4 (Meteor Lake U/H/PS (Redwood Cove - Crestmont)): Hardware+SoftwareIntel’s list
Arrow LakeAffected06_B5H stepping 0 (Arrow Lake U (Redwood Cove - Crestmont)): Hardware+Software
06_C5H stepping 2 (Arrow Lake H (Lion Cove - Skymont)): Hardware+Software
06_C6H stepping 2 (Arrow Lake H/HX/S/S Plus (Lion Cove - Skymont)): Hardware+Software
Intel’s list
Lunar LakeAffected06_BDH stepping 1 (Lunar Lake (Lion Cove - Skymont)): Hardware+SoftwareIntel’s list
Panther LakeAffected06_CCH stepping 2 - 3 (Panther Lake (Cougar Cove - Darkmont)): Hardware+SoftwareIntel’s list
Nova LakeAffectedLinux 7.3 sets the bug on INTEL_NOVALAKE, INTEL_NOVALAKE_L: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Skylake-SPAffected06_55H stepping 3 (Skylake Server): MCU+Software
06_55H stepping 4 (1. Skylake Server - 2. Skylake D/Bakerville): MCU+Software
Intel’s list
Cascade LakeAffectedLinux 7.3 sets the bug on INTEL_SKYLAKE_X steppings 5 to 7: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Cooper LakeAffected06_55H stepping B (Cooper Lake): Hardware+SoftwareIntel’s list
Ice Lake (server)Affected06_6AH stepping 6 (Ice Lake Xeon-SP): Hardware+Software
06_6CH stepping All (Ice Lake Xeon D (Idaville)): Hardware+Software
Intel’s list
Emerald RapidsAffected06_CFH stepping 2 (Emerald Rapids (Raptor Cove)): Hardware+SoftwareIntel’s list
Sapphire RapidsAffected06_8FH stepping 5 - 6 - 7 - 8 (1. Sapphire Rapids - 2. Sapphire Rapids Edge Enhanced (Golden Cove)): Hardware+Software
06_8FH stepping 5 - 6 - 8 (Sapphire Rapids (Golden Cove) - Sapphire Rapids HBM): Hardware+Software
Intel’s list
Granite RapidsAffected06_ADH stepping 1 (Granite Rapids (Redwood Cove)): Hardware+Software
06_ADH stepping 1 (Granite Rapids (Redwood Cove)): Hardware+Software
06_ADH stepping 1 (Granite Rapids R1S (Redwood Cove)): Hardware+Software
06_AEH stepping 1 (Granite Rapids D (Redwood Cove)/Kaseyville): Hardware+Software
Intel’s list
Sierra ForestAffected06_AFH stepping 3 (Sierra Forest (Crestmont)): Hardware+SoftwareIntel’s list
Clearwater ForestAffected06_DDH stepping 1 (Clearwater Forest (Darkmont)): Hardware+SoftwareIntel’s list
Diamond RapidsAffectedLinux 7.3 sets the bug on INTEL_DIAMONDRAPIDS_X: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
SilvermontAffectedLinux 7.3 sets the bug on INTEL_ATOM_SILVERMONT, INTEL_ATOM_SILVERMONT_D, INTEL_ATOM_SILVERMONT_MID, INTEL_ATOM_SILVERMONT_MID2: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
AirmontAffectedLinux 7.3 sets the bug on INTEL_ATOM_AIRMONT, INTEL_ATOM_AIRMONT_NP: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
GoldmontAffected06_5CH stepping A (Apollo Lake): MCU+Software
06_5FH stepping All (Denverton (Goldmont)): MCU+Software
Intel’s list
Goldmont PlusAffected06_7AH stepping 8 (Gemini Lake): MCU+SoftwareIntel’s list
TremontAffected06_86H stepping 5 (Snow Ridge BTS (Tremont)): Hardware+Software
06_86H stepping 7 (Parker Ridge / Snow Ridge NS/NX/BTS): Hardware+Software
06_96H stepping All (Elkhart Lake (Tremont)): Hardware+Software
06_9CH stepping All (Jasper Lake (Tremont)): Hardware+Software
Intel’s list
GracemontAffected06_9AH stepping 4 (Arizona Beach (Gracemont)): Hardware+Software
06_BEH stepping 0 (Alder Lake N (Gracemont)/Twin Lake): Hardware+Software
Intel’s list
Knights LandingAffectedLinux 7.3 sets the bug on INTEL_XEON_PHI_KNL: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Knights MillAffectedLinux 7.3 sets the bug on INTEL_XEON_PHI_KNM: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
K8 (Hammer)AffectedLinux 7.3 sets the bug on AMD family Fh: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
K10 (Family 10h)AffectedLinux 7.3 sets the bug on AMD family 10h, AMD family 12h: cpu_vuln_whitelist does not list them with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
BulldozerAffectedLinux 7.3 sets the bug on AMD family 15h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
PiledriverAffectedLinux 7.3 sets the bug on AMD family 15h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
SteamrollerAffectedLinux 7.3 sets the bug on AMD family 15h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
ExcavatorAffectedLinux 7.3 sets the bug on AMD family 15h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
ZenAffectedLinux 7.3 sets the bug on AMD family 17h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Zen+AffectedLinux 7.3 sets the bug on AMD family 17h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Zen 2AffectedLinux 7.3 sets the bug on AMD family 17h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Zen 3AffectedLinux 7.3 sets the bug on AMD family 19h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Zen 4AffectedLinux 7.3 sets the bug on AMD family 19h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Zen 5AffectedLinux 7.3 sets the bug on AMD family 1Ah: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
Zen 6AffectedLinux 7.3 sets the bug on AMD family 1Ah: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
BobcatAffectedLinux 7.3 sets the bug on AMD family 14h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
JaguarAffectedLinux 7.3 sets the bug on AMD family 16h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
PumaAffectedLinux 7.3 sets the bug on AMD family 16h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
DhyanaAffectedLinux 7.3 sets the bug on Hygon family 18h: cpu_vuln_whitelist does not list it with NO_SPECULATION or NO_SPECTRE_V2Linux 7.3
BonnellNot affectedLinux 7.3 lists INTEL_ATOM_BONNELL, INTEL_ATOM_BONNELL_MID in cpu_vuln_whitelist with NO_SPECULATIONLinux 7.3
SaltwellNot affectedLinux 7.3 lists INTEL_ATOM_SALTWELL, INTEL_ATOM_SALTWELL_MID, INTEL_ATOM_SALTWELL_TABLET in cpu_vuln_whitelist with NO_SPECULATIONLinux 7.3
LuJiaZuiNot affectedLinux 7.3 lists Centaur family 7, Zhaoxin family 7 in cpu_vuln_whitelist with NO_SPECTRE_V2Linux 7.3
Century Avenue (Shijidadao)Not affectedLinux 7.3 lists Centaur family 7, Zhaoxin family 7 in cpu_vuln_whitelist with NO_SPECTRE_V2Linux 7.3

Mitigations

  • Compiler: Retpolines: the compiler turns each indirect call or jump in the kernel into a return through a thunk whose speculative path loops in place, so no poisoned prediction is followed. Source.
  • Microcode: IBRS, STIBP and IBPB: microcode adds IA32_SPEC_CTRL (MSR 48H), whose bits restrict indirect branch speculation (IBRS) and stop sharing predictions between the threads of a core (STIBP), and IA32_PRED_CMD (MSR 49H), a write of whose bit 0 is a barrier (IBPB) that discards earlier predictions. Linux uses IBPB between processes of different users. Instructions: WRMSR. Source.
  • Hardware: Enhanced IBRS (Intel) and Automatic IBRS (AMD): set once at boot, they keep predictions made in a less privileged mode out of more privileged ones; Linux then turns retpolines off. Source.

How to check a machine

On Linux, /sys/devices/system/cpu/vulnerabilities/spectre_v2 holds one of these lines:

  • Not affected
  • Vulnerable
  • Mitigation: Retpolines
  • Mitigation: Enhanced / Automatic IBRS
  • Mitigation: Enhanced / Automatic IBRS + LFENCE
  • Mitigation: Enhanced / Automatic IBRS + Retpolines
  • Mitigation: IBRS
  • Vulnerable: LFENCE

A mitigation is followed by the state of IBPB, STIBP, RSB filling, PBRSB-eIBRS and BHI, each after a semicolon. Source.

Sources

  1. Linux 7.3 Documentation/admin-guide/hw-vuln/spectre.rst: Spectre variant 2 (Branch Target Injection)