audk/UefiCpuPkg/Library/MpInitLib
Zhichao Gao c54c856218 UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1934

0x0       MicrocodeBegin  MicrocodeEntry  MicrocodeEnd      0xffffffff
|--------------|---------------|---------------|---------------|
                                 valid TotalSize
TotalSize is only valid between 0 and (MicrocodeEnd - MicrocodeEntry).
So add '(UINTN)MicrocodeEntryPoint > (MAX_ADDRESS - TotalSize)' before
'((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd' to make sure
((UINTN)MicrocodeEntryPoint + TotalSize) wouldn't overflow.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2019-06-27 09:20:53 +08:00
..
Ia32 UefiCpuPkg/MpInitLib: increase NumApsExecuting only for ApInitConfig 2019-06-10 10:53:42 +08:00
X64 UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
DxeMpInitLib.inf UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
DxeMpInitLib.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
DxeMpLib.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
Microcode.c UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid 2019-06-27 09:20:53 +08:00
MpLib.c UefiCpuPkg/MpInitLib: Decrease NumApsExecuting only for ApInitConfig 2019-06-10 10:53:42 +08:00
MpLib.h UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
PeiMpInitLib.inf UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
PeiMpInitLib.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
PeiMpLib.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00