diff options
author | Hua Ma <hua.ma@intel.com> | 2021-09-29 13:08:14 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-10-08 06:57:55 +0000 |
commit | 5ece2ad36caa7ddc62d4954559b2cdd0d8a40a14 (patch) | |
tree | 94f08d46876e700f423403ffe08c3b5963c17c36 /BaseTools/Source/Python | |
parent | b4da6c29f1d36031e04212f53277ce0dcba309f1 (diff) | |
download | edk2-5ece2ad36caa7ddc62d4954559b2cdd0d8a40a14.tar.gz edk2-5ece2ad36caa7ddc62d4954559b2cdd0d8a40a14.tar.bz2 edk2-5ece2ad36caa7ddc62d4954559b2cdd0d8a40a14.zip |
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
Diffstat (limited to 'BaseTools/Source/Python')
0 files changed, 0 insertions, 0 deletions