summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg
diff options
context:
space:
mode:
authorZhiguang Liu <zhiguang.liu@intel.com>2024-03-11 15:32:19 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-04-16 04:41:27 +0000
commit74f6ce67343f81a842e6af3c599e4ae2a07ee51b (patch)
tree264c6c06f34ba315d98952350acb178512fe764c /StandaloneMmPkg
parentda7858117f12846e5c35922e8917fd0da07dcfef (diff)
downloadedk2-74f6ce67343f81a842e6af3c599e4ae2a07ee51b.tar.gz
edk2-74f6ce67343f81a842e6af3c599e4ae2a07ee51b.tar.bz2
edk2-74f6ce67343f81a842e6af3c599e4ae2a07ee51b.zip
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>
Diffstat (limited to 'StandaloneMmPkg')
0 files changed, 0 insertions, 0 deletions