audk/UefiCpuPkg/PiSmmCpuDxeSmm/X64
Hao Wu 02f7fd158e UefiCpuPkg/PiSmmCpuDxeSmm: [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>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2018-08-21 16:10:42 +08:00
..
MpFuncs.nasm UefiCpuPkg: Update PiSmmCpuDxeSmm pass XCODE5 tool chain 2018-01-16 23:43:08 +08:00
PageTbl.c UefiCpuPkg PiSmmCpuDxeSmm: SMM profile and static paging mutual exclusion 2017-12-08 12:29:24 +08:00
Semaphore.c UefiCpuPkg/PiSmmCpuDxeSmm: remove DBs from SmmRelocationSemaphoreComplete32() 2018-04-04 16:44:25 +02:00
SmiEntry.nasm UefiCpuPkg/PiSmmCpuDxeSmm: [CVE-2017-5715] Stuff RSB before RSM 2018-08-21 16:10:42 +08:00
SmiException.nasm UefiCpuPkg/PiSmmCpuDxeSmm: use mnemonics for FXSAVE(64)/FXRSTOR(64) 2018-04-04 16:44:27 +02:00
SmmFuncsArch.c UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
SmmInit.nasm UefiCpuPkg/PiSmmCpuDxeSmm: [CVE-2017-5715] Stuff RSB before RSM 2018-08-21 16:10:42 +08:00
SmmProfileArch.c UefiCpuPkg/PiSmmCpuDxeSmm: Add support for PCD PcdPteMemoryEncryptionAddressOrMask 2017-03-01 12:53:03 +08:00
SmmProfileArch.h UefiCpuPkg: Add PiSmmCpuDxeSmm module X64 files 2015-10-19 19:13:31 +00:00
StuffRsb.inc UefiCpuPkg/PiSmmCpuDxeSmm: [CVE-2017-5715] Stuff RSB before RSM 2018-08-21 16:10:42 +08:00