mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
SecurityPkg/Tcg2Smm: harden NVS/SMI state initialization
Signed-off-by: 20000419 <lzy20000419@outlook.com>
This commit is contained in:
parent
d372c29fab
commit
6fb6ef54e7
1 changed files with 11 additions and 4 deletions
|
|
@ -17,10 +17,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||
|
||||
#include "Tcg2Smm.h"
|
||||
|
||||
EFI_SMM_VARIABLE_PROTOCOL *mSmmVariable = NULL;
|
||||
TCG_NVS *mTcgNvs = NULL;
|
||||
UINTN mPpSoftwareSmi;
|
||||
UINTN mMcSoftwareSmi;
|
||||
EFI_SMM_VARIABLE_PROTOCOL *mSmmVariable = NULL;
|
||||
TCG_NVS *mTcgNvs = NULL;
|
||||
UINTN mPpSoftwareSmi = MAX_UINTN;
|
||||
UINTN mMcSoftwareSmi = MAX_UINTN;
|
||||
EFI_HANDLE mReadyToLockHandle;
|
||||
|
||||
/**
|
||||
|
|
@ -144,6 +144,11 @@ PhysicalPresenceCallback (
|
|||
UINT32 OperationRequest;
|
||||
UINT32 RequestParameter;
|
||||
|
||||
if (mTcgNvs == NULL) {
|
||||
DEBUG ((DEBUG_ERROR, "[%a] mTcgNvs has not been initialized yet\n", __func__));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if (mTcgNvs->PhysicalPresence.Parameter == TCG_ACPI_FUNCTION_RETURN_REQUEST_RESPONSE_TO_OS) {
|
||||
mTcgNvs->PhysicalPresence.ReturnCode = Tcg2PhysicalPresenceLibReturnOperationResponseToOsFunction (
|
||||
&MostRecentRequest,
|
||||
|
|
@ -233,6 +238,8 @@ InitializeTcgCommon (
|
|||
PpSwHandle = NULL;
|
||||
McSwHandle = NULL;
|
||||
NotifyHandle = NULL;
|
||||
mPpSoftwareSmi = MAX_UINTN;
|
||||
mMcSoftwareSmi = MAX_UINTN;
|
||||
|
||||
// Register a root handler to communicate the NVS region and SMI channel between MM and DXE
|
||||
Status = gMmst->MmiHandlerRegister (TpmNvsCommunciate, &gTpmNvsMmGuid, &mReadyToLockHandle);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue