No description
Find a file
Hao Wu f7defccaec SecurityPkg/OpalPWSupportLib: [CVE-2017-5753] Fix bounds check bypass
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1194

Speculative execution is used by processor to avoid having to wait for
data to arrive from memory, or for previous operations to finish, the
processor may speculate as to what will be executed.

If the speculation is incorrect, the speculatively executed instructions
might leave hints such as which memory locations have been brought into
cache. Malicious actors can use the bounds check bypass method (code
gadgets with controlled external inputs) to infer data values that have
been used in speculative operations to reveal secrets which should not
otherwise be accessed.

This commit will focus on the SMI handler(s) registered within the
OpalPasswordSupportLib and insert AsmLfence API to mitigate the bounds
check bypass issue.

For SMI handler SmmOpalPasswordHandler():

Under "case SMM_FUNCTION_SET_OPAL_PASSWORD:",
'&DeviceBuffer->OpalDevicePath' can points to a potential cross boundary
access of the 'CommBuffer' (controlled external inputs) during speculative
execution. This cross boundary access pointer is later passed as parameter
'DevicePath' into function OpalSavePasswordToSmm().

Within function OpalSavePasswordToSmm(), 'DevicePathLen' is an access to
the content in 'DevicePath' and can be inferred by code:
"CompareMem (&List->OpalDevicePath, DevicePath, DevicePathLen)". One can
observe which part of the content within either '&List->OpalDevicePath' or
'DevicePath' was brought into cache to possibly reveal the value of
'DevicePathLen'.

Hence, this commit adds a AsmLfence() after the boundary/range checks of
'CommBuffer' to prevent the speculative execution.

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

And the document at:
https://software.intel.com/security-software-guidance/api-app/sites/default/files/337879-analyzing-potential-bounds-Check-bypass-vulnerabilities.pdf

Cc: Star Zeng <star.zeng@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@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-11-21 09:33:45 +08:00
AppPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
ArmPkg ArmPkg: remove ARMv6 support code 2015-08-19 10:51:59 +00:00
ArmPlatformPkg ArmPlatformPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg 2015-11-30 03:20:15 +00:00
ArmVirtPkg ArmVirtPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg 2015-11-30 03:21:14 +00:00
BaseTools BaseTools: Fix UEFI and Tiano Decompression logic issue 2018-11-14 08:41:36 +08:00
BeagleBoardPkg BeagleBoardPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg 2015-11-30 03:19:26 +00:00
Conf EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
CorebootModulePkg CorebootModulePkg:Removing EFI_RESOURCE_ATTRIBUTE_TESTED 2015-08-18 16:08:22 +00:00
CorebootPayloadPkg CorebootPayloadPkg: Use SerialDxe in MdeModulePkg 2015-11-30 03:18:40 +00:00
CryptoPkg CryptoPkg/OpensslLib: Upgrade OpenSSL version to 1.0.2j 2016-10-26 14:50:53 +08:00
DuetPkg DuetPkg: Fix GCC error to avoid the duplicated global variable in SmbiosGenDxe 2015-12-18 05:45:52 +00:00
EdkCompatibilityPkg EdkCompatibilityPkg: fix ASSERT_EFI_ERROR() typos 2016-07-07 15:16:33 +08:00
EdkShellBinPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EdkShellPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EmbeddedPkg EmbeddedPkg: Remove SerialDxe and SerialPortExtLib libraries 2015-11-30 03:22:01 +00:00
EmulatorPkg EmulatorPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg 2015-11-30 03:17:57 +00:00
FatBinPkg FatBinPkg: Update EBC/IA32/X64/IPF binaries 2015-08-28 03:14:25 +00:00
IntelFrameworkModulePkg IntelFrameworkModulePkg: Fix UEFI and Tiano Decompression logic issue 2018-11-14 08:41:37 +08:00
IntelFrameworkPkg IntelFrameworkPkg/UefiLib: Avoid mis-calculate of graphic console size 2017-05-16 10:35:14 +08:00
IntelFsp2Pkg IntelFsp2Pkg: 41d739e breaks flat tree build 2016-12-05 15:31:14 +08:00
IntelFsp2WrapperPkg IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete. 2016-10-31 09:14:29 +08:00
IntelFspPkg IntelFspPkg: Add NOOPT target in IntelFspPkg.dsc 2016-02-24 15:51:20 +08:00
IntelFspWrapperPkg IntelFspWrapperPkg: PeiFspHobProcessLibSample: remove set but unused variables 2016-07-14 15:51:46 +08:00
IntelSiliconPkg IntelSiliconPkg/IgdOpRegion: Add definition for Intel IGD 2016-07-15 13:33:49 +08:00
MdeModulePkg MdeModulePkg/SmmCorePerfLib: [CVE-2017-5753] Fix bounds check bypass 2018-11-21 09:33:32 +08:00
MdePkg MdePkg/BaseLib: Add new AsmLfence API 2018-11-21 09:32:40 +08:00
NetworkPkg NetworkPkg/IpSecDxe: Add check to avoid possible divide by zero 2017-06-27 10:31:06 +08:00
Nt32Pkg Nt32Pkg/SnpNt32Dxe: Fix hang issue when multiple network interfaces existed 2017-06-27 15:10:42 +08:00
Omap35xxPkg Omap35xxPkg SerialPortLib: Implement Get(Set)Control/SetAttributes 2015-11-30 03:19:06 +00:00
OptionRomPkg OptionRomPkg: Remove redundant included header file defintion in Ax88772.h and Ax88772b.h files 2015-07-08 02:56:54 +00:00
OvmfPkg OvmfPkg: Fix VS2015 warning C4459 in XenBusDxe 2015-12-04 03:46:05 +00:00
PcAtChipsetPkg PcAtChipsetPkg AcpiTimerLib: Wait 363 ACPI timer counts to get TSC Freq 2016-08-18 12:49:32 +08:00
PerformancePkg PerformancePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr 2016-07-07 14:05:14 +08:00
SecurityPkg SecurityPkg/OpalPWSupportLib: [CVE-2017-5753] Fix bounds check bypass 2018-11-21 09:33:45 +08:00
ShellBinPkg ShellBinPkg: Arm/AArch64 Shell binary update. 2016-07-29 15:39:38 +08:00
ShellPkg ShellPkg: Unregister hotkey callback when exiting Shell 2016-07-29 12:28:12 +08:00
SourceLevelDebugPkg SourceLevelDebugPkg: DebugAgentCommon: remove set but unused variables 2016-07-14 15:51:44 +08:00
StdLib StdLib: remove mention of ARMGCC 2015-08-12 05:25:12 +00:00
StdLibPrivateInternalFiles */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
UefiCpuPkg UefiCpuPkg/PiSmmCpuDxeSmm: [CVE-2017-5753] Fix bounds check bypass 2018-11-21 09:32:47 +08:00
UnixPkg UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg) 2013-07-29 21:09:55 +00:00
Vlv2DeviceRefCodePkg Vlv2TbltDevicePkg: Sync the branch changes to trunk. 2015-08-05 07:26:45 +00:00
Vlv2TbltDevicePkg Vlv2TbltDevicePkg: fix ASSERT_EFI_ERROR() typos 2016-07-07 15:21:50 +08:00
.gitignore EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
BuildNotes2.txt BaseTools: Updated BuildNotes URLs 2016-07-13 09:30:49 +08:00
Edk2Setup.bat Sync the files in root dirctory from main trunk r19027. 2015-12-01 06:13:41 +00:00
edksetup.bat BaseTools: Add VS2015 tool chain in tools_def.template 2015-12-04 03:43:12 +00:00
edksetup.sh Sync the files in root dirctory from main trunk r19027. 2015-12-01 06:13:41 +00:00
Maintainers.txt Maintainers.txt: Update maintainers for ShellBinPkg 2016-02-25 11:33:16 +08:00