Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: a7fcab7aa3de338c02e61fd891610b1ec926e6c8
      
https://github.com/tianocore/edk2/commit/a7fcab7aa3de338c02e61fd891610b1ec926e6c8
  Author: Hua Ma <hua...@intel.com>
  Date:   2021-10-14 (Thu, 14 Oct 2021)

  Changed paths:
    M MdeModulePkg/Core/Dxe/Hand/DriverSupport.c
    M MdeModulePkg/Core/Dxe/Hand/Handle.c
    M MdeModulePkg/Core/Dxe/Hand/Handle.h
    M MdeModulePkg/Core/Dxe/Hand/Notify.c

  Log Message:
  -----------
  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.w...@intel.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Dandan Bi <dandan...@intel.com>
Cc: Ray Ni <ray...@intel.com>
Signed-off-by: Hua Ma <hua...@intel.com>
Reviewed-by: Dandan Bi <dandan...@intel.com>
Reviewed-by: Jian J Wang <jian.j.w...@intel.com>




_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to