audk/StandaloneMmPkg/Core
Zhiguang Liu 70892b13b2 StandaloneMmPkg: Support to unregister MMI handler in MMI handlers
This patch fix a use-after-free issue where unregistering an
MMI handler could lead to the deletion of the MMI_HANDLER while it is
still in use by MmiManage(). The fix involves modifying
MmiHandlerUnRegister() to detect whether it is being called from
within the MmiManage() stack. If so, the removal of the MMI_HANDLER
is deferred until MmiManage() has finished executing.
Additionally, due to the possibility of recursive MmiManage() calls,
the unregistration and subsequent removal of the MMI_HANDLER are
ensured to occur only after the outermost MmiManage() 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>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-04-16 04:41:27 +00:00
..
Dependency.c StandaloneMmPkg/Core: Remove optimization for depex evaluation 2024-01-23 18:26:25 +00:00
Dispatcher.c StandaloneMmPkg/Core: Remove dead code 2023-12-25 06:15:54 +00:00
FwVol.c StandaloneMmPkg/Core: Fix the failure to find uncompressed inner FV 2023-12-19 09:29:07 +00:00
Handle.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
InstallConfigurationTable.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Locate.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Mmi.c StandaloneMmPkg: Support to unregister MMI handler in MMI handlers 2024-04-16 04:41:27 +00:00
Notify.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Page.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Pool.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
StandaloneMmCore.c StandaloneMmPkg/Core: Limit FwVol encapsulation section recursion 2023-12-19 09:29:07 +00:00
StandaloneMmCore.h StandaloneMmPkg/Core: Remove dead code 2023-12-25 06:15:54 +00:00
StandaloneMmCore.inf StandaloneMmPkg/Core: Limit FwVol encapsulation section recursion 2023-12-19 09:29:07 +00:00
StandaloneMmCorePrivateData.h StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00