]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/DxeCore: Avoid accessing non-owned memory
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 5 Jul 2017 10:45:56 +0000 (18:45 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Tue, 18 Jul 2017 08:49:15 +0000 (16:49 +0800)
commit5fc3889bb3c64f8cd81d7d387f829f146a1998fd
tree23fe22e2a0b450a318f7fd23fee68d6dea3adac9
parent357c48258e0b452d31f487a47dca486ba666a954
MdeModulePkg/DxeCore: Avoid accessing non-owned memory

The patch fixes two kinds of bugs in DxeCore that accesses memory
which might be freed or owned by other modules.
The two bugs don't cause functionality issue.

1. CoreValidateHandle() checks whether the handle is valid by
   validating its signature. The proper way is to check whether
   the handle is in the handle database.
2. CoreDisconnectControllersUsingProtocolInterface() and
   CoreOpenProtocol() de-reference Link pointer which is
   already freed. The proper way is to not de-reference the pointer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Core/Dxe/Hand/Handle.c