audk/StandaloneMmPkg
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
..
Core StandaloneMmPkg: Support to unregister MMI handler in MMI handlers 2024-04-16 04:41:27 +00:00
Drivers/StandaloneMmCpu StandaloneMmPkg: Make StandaloneMmCpu driver architecture independent 2024-02-27 12:27:58 +00:00
Include StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver 2024-02-27 12:27:58 +00:00
Library StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver 2024-02-27 12:27:58 +00:00
StandaloneMmPkg.ci.yaml StandaloneMmPkg: Update YAML to ignore specific ECC files/errors 2021-11-30 14:19:07 +00:00
StandaloneMmPkg.dec StandaloneMmPkg: Make StandaloneMmCpu driver architecture independent 2024-02-27 12:27:58 +00:00
StandaloneMmPkg.dsc StandaloneMmPkg: build for 32bit arm machines 2021-08-11 11:32:32 +00:00