audk/MdeModulePkg/Core
Hua Ma a7fcab7aa3 MdeModulePkg/Core/Dxe: Acquire a lock when iterating gHandleList
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3680

This patch fixes the following issue:

The global variable gHandleList is a linked list.
This list is locked when a entry is added or removed from the list,
but there is no lock when iterating this list in function
CoreValidateHandle().
It can lead to "Handle.c (76): CR has Bad Signature" assertion if the
iterated entry in the list is just removed by other task during iterating.

Currently some caller functions of CoreValidateHandle() have
CoreAcquireProtocolLock(), but some caller functions of
CoreValidateHandle() do not CoreAcquireProtocolLock().
Add CoreAcquireProtocolLock() always when CoreValidateHandle() is called,
Also, A lock check is added in the CoreValidateHandle().

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Hua Ma <hua.ma@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2021-10-14 03:27:20 +00:00
..
Dxe MdeModulePkg/Core/Dxe: Acquire a lock when iterating gHandleList 2021-10-14 03:27:20 +00:00
DxeIplPeim MdeModulePkg/DxeIplPeim: Support GHCB pages when creating page tables 2020-08-16 16:45:42 +00:00
Pei MdeModulePkg/Core/Pei: Fix pointer size mismatch in EvacuateTempRam() 2021-09-16 01:51:36 +00:00
PiSmmCore MdeModulePkg/PiSmmCore: Drop deprecated image profiling commands 2021-09-01 04:58:21 +00:00
RuntimeDxe MdeModulePkg: document workaround for EFI_RUNTIME_EVENT_ENTRY PI spec bug 2019-10-09 09:40:09 +02:00