TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmLockBox.c File Reference

Go to the source code of this file.

Functions

VOID SmmLockBoxSave (IN EFI_SMM_LOCK_BOX_PARAMETER_SAVE *LockBoxParameterSave)
 
VOID SmmLockBoxSetAttributes (IN EFI_SMM_LOCK_BOX_PARAMETER_SET_ATTRIBUTES *LockBoxParameterSetAttributes)
 
VOID SmmLockBoxUpdate (IN EFI_SMM_LOCK_BOX_PARAMETER_UPDATE *LockBoxParameterUpdate)
 
VOID SmmLockBoxRestore (IN EFI_SMM_LOCK_BOX_PARAMETER_RESTORE *LockBoxParameterRestore)
 
VOID SmmLockBoxRestoreAllInPlace (IN EFI_SMM_LOCK_BOX_PARAMETER_RESTORE_ALL_IN_PLACE *LockBoxParameterRestoreAllInPlace)
 
EFI_STATUS EFIAPI SmmLockBoxHandler (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
 
EFI_STATUS EFIAPI SmmReadyToLockEventNotify (IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle)
 
EFI_STATUS EFIAPI SmmLockBoxEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

BOOLEAN mLocked = FALSE
 

Detailed Description

LockBox SMM driver.

Caution: This module requires additional review when modified. This driver will have external input - communicate buffer in SMM mode. This external input must be validated carefully to avoid security issue like buffer overflow, integer overflow.

SmmLockBoxHandler(), SmmLockBoxRestore(), SmmLockBoxUpdate(), SmmLockBoxSave() will receive untrusted input and do basic validation.

Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SmmLockBox.c.

Function Documentation

◆ SmmLockBoxEntryPoint()

EFI_STATUS EFIAPI SmmLockBoxEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Entry Point for LockBox SMM driver.

Parameters
[in]ImageHandleImage handle of this driver.
[in]SystemTableA Pointer to the EFI System Table.
Return values
EFI_SUCEESS
Returns
Others Some error occurs.

Definition at line 401 of file SmmLockBox.c.

◆ SmmLockBoxHandler()

EFI_STATUS EFIAPI SmmLockBoxHandler ( IN EFI_HANDLE  DispatchHandle,
IN CONST VOID *Context  OPTIONAL,
IN OUT VOID *CommBuffer  OPTIONAL,
IN OUT UINTN *CommBufferSize  OPTIONAL 
)

Dispatch function for a Software SMI handler.

Caution: This function may receive untrusted input. Communicate buffer and buffer size are external input, so this function will do basic validation.

Parameters
DispatchHandleThe unique handle assigned to this handler by SmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-SMM environment into an SMM environment.
CommBufferSizeThe size of the CommBuffer.
Return values
EFI_SUCCESSCommand is handled successfully.

Definition at line 272 of file SmmLockBox.c.

◆ SmmLockBoxRestore()

VOID SmmLockBoxRestore ( IN EFI_SMM_LOCK_BOX_PARAMETER_RESTORE LockBoxParameterRestore)

Dispatch function for SMM lock box restore.

Caution: This function may receive untrusted input. Restore buffer and length are external input, so this function will validate it is in SMRAM.

Parameters
LockBoxParameterRestoreparameter of lock box restore

Definition at line 192 of file SmmLockBox.c.

◆ SmmLockBoxRestoreAllInPlace()

VOID SmmLockBoxRestoreAllInPlace ( IN EFI_SMM_LOCK_BOX_PARAMETER_RESTORE_ALL_IN_PLACE LockBoxParameterRestoreAllInPlace)

Dispatch function for SMM lock box restore all in place.

Parameters
LockBoxParameterRestoreAllInPlaceparameter of lock box restore all in place

Definition at line 243 of file SmmLockBox.c.

◆ SmmLockBoxSave()

VOID SmmLockBoxSave ( IN EFI_SMM_LOCK_BOX_PARAMETER_SAVE LockBoxParameterSave)

Dispatch function for SMM lock box save.

Caution: This function may receive untrusted input. Restore buffer and length are external input, so this function will validate it is in SMRAM.

Parameters
LockBoxParameterSaveparameter of lock box save

Definition at line 46 of file SmmLockBox.c.

◆ SmmLockBoxSetAttributes()

VOID SmmLockBoxSetAttributes ( IN EFI_SMM_LOCK_BOX_PARAMETER_SET_ATTRIBUTES LockBoxParameterSetAttributes)

Dispatch function for SMM lock box set attributes.

Parameters
LockBoxParameterSetAttributesparameter of lock box set attributes

Definition at line 97 of file SmmLockBox.c.

◆ SmmLockBoxUpdate()

VOID SmmLockBoxUpdate ( IN EFI_SMM_LOCK_BOX_PARAMETER_UPDATE LockBoxParameterUpdate)

Dispatch function for SMM lock box update.

Caution: This function may receive untrusted input. Restore buffer and length are external input, so this function will validate it is in SMRAM.

Parameters
LockBoxParameterUpdateparameter of lock box update

Definition at line 136 of file SmmLockBox.c.

◆ SmmReadyToLockEventNotify()

EFI_STATUS EFIAPI SmmReadyToLockEventNotify ( IN CONST EFI_GUID Protocol,
IN VOID *  Interface,
IN EFI_HANDLE  Handle 
)

Smm Ready To Lock event notification handler.

It sets a flag indicating that SMRAM has been locked.

Parameters
[in]ProtocolPoints to the protocol's unique identifier.
[in]InterfacePoints to the interface instance.
[in]HandleThe handle on which the interface was installed.
Return values
EFI_SUCCESSNotification handler runs successfully.

Definition at line 380 of file SmmLockBox.c.

Variable Documentation

◆ mLocked

BOOLEAN mLocked = FALSE

Definition at line 34 of file SmmLockBox.c.