audk/MdeModulePkg/Core
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
..
Dxe MdeModulePkg: MemoryProtection: Use ImageRecordPropertiesLib 2024-03-29 23:56:16 +00:00
DxeIplPeim MdeModulePkg/DxeIplPeim: rename variable 2024-02-29 09:56:38 +00:00
Pei MdeModulePkg: DxeCore: Correct Runtime Granularity Memory Type 2024-03-14 16:29:22 +00:00
PiSmmCore MdeModulePkg/SMM: Support to unregister SMI handler in SMI handlers 2024-04-16 04:41:27 +00:00
RuntimeDxe MdeModulePkg: Align RuntimeDxe function headers with UEFI return values 2024-02-09 22:16:32 +00:00