audk/MdeModulePkg/Core/PiSmmCore
Zhiguang Liu 74f6ce6734 MdeModulePkg/SMM: Support to unregister SMI handler in SMI handlers
This patch fix a use-after-free issue where unregistering an
SMI handler could lead to the deletion of the SMI_HANDLER while it is
still in use by SmiManage(). The fix involves modifying
SmiHandlerUnRegister() to detect whether it is being called from
within the SmiManage() stack. If so, the removal of the SMI_HANDLER
is deferred until SmiManage() has finished executing.
Additionally, due to the possibility of recursive SmiManage() calls,
the unregistration and subsequent removal of the SMI_HANDLER are
ensured to occur only after the outermost SmiManage() invocation has
completed.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-04-16 04:41:27 +00:00
..
Dependency.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Dispatcher.c MdeModulePkg/SmmCore: Add perf-logging for SmmDriverDispatchHandler 2023-06-21 04:37:17 +00:00
Handle.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
HeapGuard.c MdeModulePkg: Remove other attribute protection in UnsetGuardPage 2023-06-30 11:07:40 +05:30
HeapGuard.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
InstallConfigurationTable.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Locate.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MemoryAttributesTable.c MdeModulePkg: Update DumpImageRecord() in ImagePropertiesRecordLib 2023-11-27 18:55:18 +00:00
Notify.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Page.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PiSmmCore.c MdeModulePkg/SmmCore: Perf-log PlatformHookBefore/AfterSmmDispatch 2023-06-21 04:37:17 +00:00
PiSmmCore.h MdeModulePkg/SMM: Support to unregister SMI handler in SMI handlers 2024-04-16 04:41:27 +00:00
PiSmmCore.inf MdeModulePkg: Transition SMM MAT Logic to Use ImagePropertiesRecordLib 2023-11-27 18:55:18 +00:00
PiSmmCore.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
PiSmmCoreExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
PiSmmCorePrivateData.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PiSmmIpl.c MdeModulePkg/PiSmmCore: SmmEntryPoint underflow (CVE-2021-38578) 2022-11-04 01:58:20 +00:00
PiSmmIpl.inf MdeModulePkg/PiSmmCore: SmmEntryPoint underflow (CVE-2021-38578) 2022-11-04 01:58:20 +00:00
PiSmmIpl.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
PiSmmIplExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
Pool.c MdeModulePkg: PiSmmCore: Inspect memory guarded with pool headers 2022-05-13 00:51:41 +00:00
Smi.c MdeModulePkg/SMM: Support to unregister SMI handler in SMI handlers 2024-04-16 04:41:27 +00:00
SmiHandlerProfile.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmramProfileRecord.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00