No description
Find a file
Hao Wu 49fa59e82e UefiCpuPkg/PiSmmCpuDxeSmm: [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.

It is possible for SMI handler(s) to call EFI_SMM_CPU_PROTOCOL service
ReadSaveState() and use the content in the 'CommBuffer' (controlled
external inputs) as the 'CpuIndex'. So this commit will insert AsmLfence
API to mitigate the bounds check bypass issue within SmmReadSaveState().

For SmmReadSaveState():

The 'CpuIndex' will be passed into function ReadSaveStateRegister(). And
then in to ReadSaveStateRegisterByIndex().

With the call:
ReadSaveStateRegisterByIndex (
  CpuIndex,
  SMM_SAVE_STATE_REGISTER_IOMISC_INDEX,
  sizeof(IoMisc.Uint32),
  &IoMisc.Uint32
  );

The 'IoMisc' can be a cross boundary access during speculative execution.
Later, 'IoMisc' is used as the index to access buffers 'mSmmCpuIoWidth'
and 'mSmmCpuIoType'. One can observe which part of the content within
those buffers was brought into cache to possibly reveal the value of
'IoMisc'.

Hence, this commit adds a AsmLfence() after the check of 'CpuIndex'
within function SmmReadSaveState() 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: 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: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit 5b02be4d9a)
2018-11-16 09:00:05 +08:00
AppPkg AppPkg/WebServer: Fix build failure. 2017-09-14 08:55:09 +08:00
ArmPkg ArmPkg/ArmMmuLib ARM: fix page size granularity in initial MMU setting 2017-12-20 20:57:03 +00:00
ArmPlatformPkg ArmPlatformPkg: retire obsolete PCDs 2017-12-12 17:40:17 +00:00
ArmVirtPkg ArmVirtPkg: Remove the UDF file system support 2017-12-29 11:12:35 +08:00
BaseTools BaseTools: Fix UEFI and Tiano Decompression logic issue 2018-11-14 08:38:20 +08:00
BeagleBoardPkg BeagleBoardPkg: clone MemoryInitPeiLib 2017-11-30 17:08:41 +00:00
Conf EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
CorebootModulePkg CorebootModulePkg/CbSupportDxe: Remove duplicated IO Space addition 2017-11-16 10:52:00 +08:00
CorebootPayloadPkg CorebootPayloadPkg: Fix build failure due to Tftp/Dp library removal 2017-11-29 10:56:12 +08:00
CryptoPkg CryptoPkg/OpensslLib: remove OpenSSL version number from OpenSSL-HOWTO.txt 2018-08-01 10:20:22 +08:00
DuetPkg DuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined 2017-08-11 08:44:54 +08:00
EdkCompatibilityPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
EdkShellBinPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
EdkShellPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
EmbeddedPkg EmbeddedPkg: add ConsolePrefDxe to package .dsc 2017-12-15 17:00:28 +00:00
EmulatorPkg EmulatorPkg: Undefine CR3 macro in Host.h 2018-02-28 14:50:04 +08:00
FatBinPkg FatBinPkg: New EnhancedFatDxe binaries for IA32, X64, EBC and IPF 2017-12-22 09:40:18 +08:00
FatPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
FmpDevicePkg FmpDevicePkg FmpDxe: Lock variables in entrypoint instead of callback 2018-08-08 19:19:46 +08:00
IntelFrameworkModulePkg IntelFrameworkModulePkg: Fix UEFI and Tiano Decompression logic issue 2018-11-14 08:38:22 +08:00
IntelFrameworkPkg IntelFrameworkPkg FrameworkUefiLib: Fix in EfiLocateProtocolBuffer() 2018-07-09 13:34:24 +08:00
IntelFsp2Pkg IntelFsp2Pkg/GenCfgOpt.py: Support PCD input from command line 2018-10-25 09:19:35 +08:00
IntelFsp2WrapperPkg IntelFsp2WrapperPkg: Update BaseFspWrapperApiLib to pass XCODE5 build 2018-01-19 13:04:33 +08:00
IntelFspPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelFspWrapperPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelSiliconPkg IntelSiliconPkg IntelVTdDxe: Check HeaderType if func 0 is implemented 2018-11-07 22:00:47 +08:00
MdeModulePkg MdeModulePkg/Variable: [CVE-2017-5753] Fix bounds check bypass 2018-11-16 09:00:05 +08:00
MdePkg MdePkg/BaseLib: Add new AsmLfence API 2018-11-16 09:00:05 +08:00
NetworkPkg NetworkPkg/NetworkPkg.dsc: Add the instance of library class [SafeIntLib]. 2018-07-25 10:10:27 +08:00
Nt32Pkg Nt32Pkg/Nt32Pkg.fdf: Increase the size of FLASH Device. 2018-02-08 08:27:19 +08:00
Omap35xxPkg Omap35xxPkg: add GetTimeInNanoSecond implementation 2017-11-30 14:32:30 +00:00
OptionRomPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
OvmfPkg OvmfPkg: Add SafeIntLib and BmpSupportLib to DSC files 2018-07-11 14:30:23 +08:00
PcAtChipsetPkg PcAtChipsetPkg PeiAcpiTimerLib: Add the missing DebugLib header file 2018-02-24 11:00:28 +08:00
QuarkPlatformPkg QuarkPlatformPkg: remove TrEE reference. 2018-03-16 14:38:02 +08:00
QuarkSocPkg QuarkSocPkg/QNCSmmDispatcher: Fix use after free issue #2 2017-08-16 19:42:17 -07:00
SecurityPkg SecurityPkg/Tcg2Smm: Correct function parameter attribute 2018-07-27 11:02:16 +08:00
ShellBinPkg ShellBinPkg: Update ReadMe.txt 2018-03-19 14:39:58 +08:00
ShellPkg ShellPkg/UefiHandleParsingLib: remove TrEE reference. 2018-03-16 14:37:59 +08:00
SignedCapsulePkg SignedCapsulePkg SystemFirmwareReportDxe: Try LocateProtocol 2018-08-01 10:07:01 +08:00
SourceLevelDebugPkg SourceLevelDebugPkg DebugCommUsb3: Return error when debug cap is reset 2018-03-21 10:27:46 +08:00
StdLib StdLib/BsdSocketLib: Remove unused variables 2017-11-13 07:39:06 -08:00
StdLibPrivateInternalFiles edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
UefiCpuPkg UefiCpuPkg/PiSmmCpuDxeSmm: [CVE-2017-5753] Fix bounds check bypass 2018-11-16 09:00:05 +08:00
UnixPkg UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg) 2013-07-29 21:09:55 +00:00
Vlv2DeviceRefCodePkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
Vlv2TbltDevicePkg Vlv2TbltDevicePkg: Update DSC/FDF to use FmpDevicePkg 2018-08-10 09:34:18 -07:00
.gitignore edk2: Add .DS_Store to .gitignore for macOS 2017-05-19 15:14:34 -07:00
.gitmodules CryptoPkg: Adding OpenSSL as one submodule of EDKII repo 2018-01-18 14:08:57 +08:00
BuildNotes2.txt BaseTools: Updated BuildNotes URLs 2016-03-25 09:46:44 +08:00
Contributions.txt edk2: Fix typo in Contributions.txt 2017-08-16 17:50:44 +08:00
edksetup.bat BaseTools: suppress usage instructions with rebuild options 2017-07-04 10:16:13 +08:00
edksetup.sh BaseTools/edksetup.sh: fix invalid test for current working directory 2017-08-10 12:54:58 +08:00
License.txt edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
Maintainers.txt Maintainers.txt: Add FmpDevicePkg maintainers 2018-08-09 23:10:50 -07:00
Readme.md edk2: Add Readme.md to root of edk2 repository 2017-08-03 11:02:25 -07:00

EDK II Project

A modern, feature-rich, cross-platform firmware development environment for the UEFI and PI specifications from www.uefi.org.

Contributions to the EDK II open source project are covered by the TianoCore Contribution Agreement 1.1

The majority of the content in the EDK II open source project uses a BSD 2-Clause License. The EDK II open source project contains the following components that are covered by additional licenses:

The EDK II Project is composed of packages. The maintainers for each package are listed in Maintainers.txt.

Resources