audk/UefiCpuPkg
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
..
Application/Cpuid UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
CpuDxe UefiCpuPkg/CpuDxe: fix incorrect check of SMM mode 2018-07-20 10:34:11 +08:00
CpuFeatures UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
CpuIo2Dxe UefiCpuPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:52 +08:00
CpuIo2Smm UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
CpuIoPei UefiCpuPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:52 +08:00
CpuMpPei UefiCpuPkg/CpuMpPei: Correct BIST PPI logic. 2018-07-24 08:35:33 +08:00
CpuS3DataDxe UefiCpuPkg/CpuS3DataDxe: Remove below 4G limitation. 2018-08-16 08:42:01 +08:00
Include UefiCpuPkg/AcpiCpuData.h: Remove AcpiNVS and Below 4G limitation. 2018-08-16 08:42:00 +08:00
Library UefiCpuPkg/SmmCpuFeaturesLib: [CVE-2017-5715] Stuff RSB before RSM 2018-08-21 16:11:15 +08:00
PiSmmCommunication UefiCpuPkg PiSmmCommunicationSmm: Deprecate SMM Communication ACPI Table 2017-07-27 14:08:09 +08:00
PiSmmCpuDxeSmm UefiCpuPkg/PiSmmCpuDxeSmm: [CVE-2017-5715] Stuff RSB before RSM 2018-08-21 16:10:42 +08:00
ResetVector UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
SecCore UefiCpuPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:52 +08:00
Universal/Acpi/S3Resume2Pei UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
UefiCpuPkg.dec UefiCpuPkg: Update package version. 2018-01-22 19:23:56 +08:00
UefiCpuPkg.dsc UefiCpuPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:52 +08:00
UefiCpuPkg.uni UefiCpuPkg/UefiCpuPkg.uni: Add missing string definition for new PCDs 2017-12-26 09:44:14 +08:00
UefiCpuPkgExtra.uni UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00