x86/speculation: Add RSB VM Exit protections
stable inclusion from stable-v4.19.255 commit b6c5011934a15762cd694e36fe74f2f2f93eac9b category: bugfix bugzilla: 187492, https://gitee.com/src-openeuler/kernel/issues/I5N1SO CVE: CVE-2022-26373 -------------------------------- commit 2b1299322016731d56807aa49254a5ea3080b6b3 upstream. tl;dr: The Enhanced IBRS mitigation for Spectre v2 does not work as documented for RET instructions after VM exits. Mitigate it with a new one-entry RSB stuffing mechanism and a new LFENCE. == Background == Indirect Branch Restricted Speculation (IBRS) was designed to help mitigate Branch Target Injection and Speculative Store Bypass, i.e. Spectre, attacks. IBRS prevents software run in less privileged modes from affecting branch prediction in more privileged modes. IBRS requires the MSR to be written on every privilege level change. To overcome some of the performance issues of IBRS, Enhanced IBRS was introduced. eIBRS is an "always on" IBRS, in other words, just turn it o...
Showing
- Documentation/admin-guide/hw-vuln/spectre.rst 8 additions, 0 deletionsDocumentation/admin-guide/hw-vuln/spectre.rst
- arch/x86/include/asm/cpufeatures.h 2 additions, 0 deletionsarch/x86/include/asm/cpufeatures.h
- arch/x86/include/asm/msr-index.h 4 additions, 0 deletionsarch/x86/include/asm/msr-index.h
- arch/x86/include/asm/nospec-branch.h 15 additions, 0 deletionsarch/x86/include/asm/nospec-branch.h
- arch/x86/kernel/cpu/bugs.c 60 additions, 1 deletionarch/x86/kernel/cpu/bugs.c
- arch/x86/kernel/cpu/common.c 10 additions, 2 deletionsarch/x86/kernel/cpu/common.c
- arch/x86/kvm/vmx.c 3 additions, 3 deletionsarch/x86/kvm/vmx.c
Please register or sign in to comment