Fixed potential security issue introduced by SmramCpuNvs variable.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Shifei Lu <shifeix.a.lu@intel.com> Reviewed-by: David Wei <david.wei@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17683 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -872,6 +872,9 @@
|
|||||||
gEfiCpuTokenSpaceGuid.PcdCpuHotPlugDataAddress|0
|
gEfiCpuTokenSpaceGuid.PcdCpuHotPlugDataAddress|0
|
||||||
gEfiCpuTokenSpaceGuid.PcdCpuCallbackSignal|0
|
gEfiCpuTokenSpaceGuid.PcdCpuCallbackSignal|0
|
||||||
gEfiCpuTokenSpaceGuid.PcdCpuConfigContextBuffer|0
|
gEfiCpuTokenSpaceGuid.PcdCpuConfigContextBuffer|0
|
||||||
|
gEfiVLVTokenSpaceGuid.PcdCpuLockBoxDataAddress|0
|
||||||
|
gEfiVLVTokenSpaceGuid.PcdCpuSmramCpuDataAddress|0
|
||||||
|
gEfiVLVTokenSpaceGuid.PcdCpuLockBoxSize|0
|
||||||
|
|
||||||
[Components.IA32]
|
[Components.IA32]
|
||||||
|
|
||||||
|
@@ -874,6 +874,9 @@
|
|||||||
gEfiCpuTokenSpaceGuid.PcdCpuHotPlugDataAddress|0
|
gEfiCpuTokenSpaceGuid.PcdCpuHotPlugDataAddress|0
|
||||||
gEfiCpuTokenSpaceGuid.PcdCpuCallbackSignal|0
|
gEfiCpuTokenSpaceGuid.PcdCpuCallbackSignal|0
|
||||||
gEfiCpuTokenSpaceGuid.PcdCpuConfigContextBuffer|0
|
gEfiCpuTokenSpaceGuid.PcdCpuConfigContextBuffer|0
|
||||||
|
gEfiVLVTokenSpaceGuid.PcdCpuLockBoxDataAddress|0
|
||||||
|
gEfiVLVTokenSpaceGuid.PcdCpuSmramCpuDataAddress|0
|
||||||
|
gEfiVLVTokenSpaceGuid.PcdCpuLockBoxSize|0
|
||||||
|
|
||||||
[Components.IA32]
|
[Components.IA32]
|
||||||
|
|
||||||
|
@@ -871,6 +871,9 @@
|
|||||||
gEfiCpuTokenSpaceGuid.PcdCpuHotPlugDataAddress|0
|
gEfiCpuTokenSpaceGuid.PcdCpuHotPlugDataAddress|0
|
||||||
gEfiCpuTokenSpaceGuid.PcdCpuCallbackSignal|0
|
gEfiCpuTokenSpaceGuid.PcdCpuCallbackSignal|0
|
||||||
gEfiCpuTokenSpaceGuid.PcdCpuConfigContextBuffer|0
|
gEfiCpuTokenSpaceGuid.PcdCpuConfigContextBuffer|0
|
||||||
|
gEfiVLVTokenSpaceGuid.PcdCpuLockBoxDataAddress|0
|
||||||
|
gEfiVLVTokenSpaceGuid.PcdCpuSmramCpuDataAddress|0
|
||||||
|
gEfiVLVTokenSpaceGuid.PcdCpuLockBoxSize|0
|
||||||
|
|
||||||
[Components.IA32]
|
[Components.IA32]
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
This driver is for ECP platforms.
|
This driver is for ECP platforms.
|
||||||
|
|
||||||
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
|
|
||||||
This program and the accompanying materials are licensed and made available under
|
This program and the accompanying materials are licensed and made available under
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <PiSmm.h>
|
#include <PiSmm.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Library/UefiDriverEntryPoint.h>
|
||||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||||
#include <Library/SmmServicesTableLib.h>
|
#include <Library/SmmServicesTableLib.h>
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
@@ -61,30 +62,16 @@ SmramSaveInfoHandler (
|
|||||||
for input values for which it is registered.
|
for input values for which it is registered.
|
||||||
|
|
||||||
@return None
|
@return None
|
||||||
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
{
|
|
||||||
EFI_STATUS Status;
|
|
||||||
UINT64 VarData[3];
|
|
||||||
UINTN VarSize;
|
|
||||||
|
|
||||||
ASSERT (DispatchContext != NULL);
|
|
||||||
ASSERT (DispatchContext->SwSmiInputValue == SMM_FROM_SMBASE_DRIVER);
|
|
||||||
|
|
||||||
if (!mLocked && IoRead8 (mSmiDataRegister) == SMM_FROM_CPU_DRIVER_SAVE_INFO) {
|
|
||||||
SmramSaveInfoHandler (
|
SmramSaveInfoHandler (
|
||||||
Status = gRT->GetVariable (
|
IN EFI_HANDLE DispatchHandle,
|
||||||
L"SmramCpuNvs",
|
IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext
|
||||||
&mSmramCpuNvsHeaderGuid,
|
)
|
||||||
{
|
{
|
||||||
ASSERT (DispatchContext != NULL);
|
ASSERT (DispatchContext != NULL);
|
||||||
VarData
|
|
||||||
ASSERT (DispatchContext->SwSmiInputValue == SMM_FROM_SMBASE_DRIVER);
|
ASSERT (DispatchContext->SwSmiInputValue == SMM_FROM_SMBASE_DRIVER);
|
||||||
|
|
||||||
if (!mLocked && IoRead8 (mSmiDataRegister) == SMM_FROM_CPU_DRIVER_SAVE_INFO) {
|
if (!mLocked && IoRead8 (mSmiDataRegister) == SMM_FROM_CPU_DRIVER_SAVE_INFO) {
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# A helper driver to save information to SMRAM after SMRR is enabled.
|
# A helper driver to save information to SMRAM after SMRR is enabled.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
|
|
||||||
# This program and the accompanying materials are licensed and made available under
|
# This program and the accompanying materials are licensed and made available under
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
#
|
#
|
||||||
# The following information is for reference only and not required by the build tools.
|
# The following information is for reference only and not required by the build tools.
|
||||||
#
|
#
|
||||||
|
# VALID_ARCHITECTURES = IA32 X64
|
||||||
#
|
#
|
||||||
|
|
||||||
[Sources.common]
|
[Sources.common]
|
||||||
@@ -53,6 +54,11 @@
|
|||||||
UefiDriverEntryPoint
|
UefiDriverEntryPoint
|
||||||
UefiRuntimeServicesTableLib
|
UefiRuntimeServicesTableLib
|
||||||
SmmServicesTableLib
|
SmmServicesTableLib
|
||||||
|
BaseLib
|
||||||
|
BaseMemoryLib
|
||||||
|
IoLib
|
||||||
|
|
||||||
|
[Protocols]
|
||||||
gEfiSmmSwDispatchProtocolGuid ## CONSUMED
|
gEfiSmmSwDispatchProtocolGuid ## CONSUMED
|
||||||
gEfiSmmControlProtocolGuid ## CONSUMED
|
gEfiSmmControlProtocolGuid ## CONSUMED
|
||||||
gEfiSmmReadyToLockProtocolGuid ## CONSUMED
|
gEfiSmmReadyToLockProtocolGuid ## CONSUMED
|
||||||
|
Reference in New Issue
Block a user