audk/MdeModulePkg
Hua Ma 5ece2ad36c MdeModulePkg/Core/Dxe: Add lock protection in CoreLocateHandleBuffer()
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3666

Currently, CoreLocateHandleBuffer() follows three steps:
1) get the size of protocol database firstly
2) allocate the buffer based on the size
3) get the protocol database into the buffer
There is no lock protection for the whole three steps. If a new protocol
added in step 2) by other task, e.g. (event timer handle USB device
hotplug). The size of protocol database may be increased and cannot fit
into the previous buffer in step 3). The protocol database cannot be
returned successfully, EFI_BUFFER_TOO_SMALL error will be returned.

This patch adds the lock to protect the whole three steps.
It can make sure the correct protocol database be returned.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Hua Ma <hua.ma@intel.com>
Reviewed-by: Dandan Bi dandan.bi@intel.com
Reviewed-by: Liming Gao gaoliming@byosoft.com.cn
2021-10-08 06:57:55 +00:00
..
Application MdeModulePkg/BootManagerMenuApp: Limit string drawing within one line 2021-09-29 09:38:58 +08:00
Bus MdeModulePkg/PciBusDxe: Improve the flow of testing support attributes 2021-09-26 02:43:46 +00:00
Core MdeModulePkg/Core/Dxe: Add lock protection in CoreLocateHandleBuffer() 2021-10-08 06:57:55 +00:00
Include MdeModulePkg/PiSmmCore: Drop deprecated image profiling commands 2021-09-01 04:58:21 +00:00
Library MdeModulePkg/UefiSortLib:Add UefiSortLib unit test 2021-08-12 08:34:04 +00:00
Logo MdeModulePkg/Logo:Add RISCV64 architecture 2020-05-07 03:17:15 +00:00
Test MdeModulePkg/UefiSortLib:Add UefiSortLib unit test 2021-08-12 08:34:04 +00:00
Universal MdeModulePkg: Fix typo of "memory" in RamDiskDxe debug message 2021-09-03 03:10:30 +00:00
MdeModulePkg.ci.yaml MdeModulePkg: CI YAML: Added new GUID to ignore duplicate list 2021-09-30 01:47:50 +00:00
MdeModulePkg.dec MdeModulePkg: Add BootDiscoveryPolicyUiLib. 2021-08-03 04:59:12 +00:00
MdeModulePkg.dsc MdeModulePkg: Add BootDiscoveryPolicyUiLib. 2021-08-03 04:59:12 +00:00
MdeModulePkg.uni MdeModulePkg: Fix various typos 2021-05-17 02:10:31 +00:00
MdeModulePkgExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00