audk/UefiCpuPkg/Library
Hao Wu 0df5056012 UefiCpuPkg/SmmCpuFeaturesLib: [CVE-2017-5715] Stuff RSB before RSM
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1093

Return Stack Buffer (RSB) is used to predict the target of RET
instructions. When the RSB underflows, some processors may fall back to
using branch predictors. This might impact software using the retpoline
mitigation strategy on those processors.

This commit will add RSB stuffing logic before returning from SMM (the RSM
instruction) to avoid interfering with non-SMM usage of the retpoline
technique.

After the stuffing, RSB entries will contain a trap like:

@SpecTrap:
    pause
    lfence
    jmp     @SpecTrap

A more detailed explanation of the purpose of commit is under the
'Branch target injection mitigation' section of the below link:
https://software.intel.com/security-software-guidance/insights/host-firmware-speculative-execution-side-channel-mitigation

Please note that this commit requires further actions (BZ 1091) to remove
the duplicated 'StuffRsb.inc' files and merge them into one under a
UefiCpuPkg package-level directory (such as UefiCpuPkg/Include/).

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1091

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2018-08-21 16:11:15 +08:00
..
BaseUefiCpuLib UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
BaseXApicLib UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
BaseXApicX2ApicLib UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
CpuCommonFeaturesLib UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
CpuExceptionHandlerLib UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
MpInitLib UefiCpuPkg/MpInitLib: Not use disabled AP when call StartAllAPs. 2018-07-26 16:54:18 +08:00
MtrrLib UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
PlatformSecLibNull UefiCpuPkg: Convert all .uni files to utf-8 2015-12-15 04:59:14 +00:00
RegisterCpuFeaturesLib UefiCpuPkg/RegisterCpuFeaturesLib: Combine implementation. 2018-08-16 08:42:01 +08:00
SecPeiDxeTimerLibUefiCpu UefiCpuPkg: Removing ipf which is no longer supported from edk2. 2018-08-14 08:58:28 +08:00
SmmCpuFeaturesLib UefiCpuPkg/SmmCpuFeaturesLib: [CVE-2017-5715] Stuff RSB before RSM 2018-08-21 16:11:15 +08:00
SmmCpuPlatformHookLibNull UefiCpuPkg: Convert all .uni files to utf-8 2015-12-15 04:59:14 +00:00