audk/CryptoPkg/Library/BaseCryptLib
Long Qin 269f3b5180 CryptoPkg/BaseCryptLib: Fix potential integer overflow issue.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1275

The LookupFreeMemRegion() in RuntimeMemAllocate.c is used to look-up
free memory region for runtime resource allocation, which was designed
to support runtime authenticated variable service.
The ReqPages in this function is the required pages to be allocated,
which depends on the malloc() call in internal OpenSSL routines. The
direct offset subtractions on ReqPages may bring possible integer
overflow issue.

This patch is to add the extra parameter checks to remove this possible
overflow risk.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Long Qin <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
2018-10-31 11:07:53 +08:00
..
Cipher CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00
Hash CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00
Hmac CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00
Pem CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00
Pk CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00
Rand CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00
SysCall CryptoPkg/BaseCryptLib: Fix potential integer overflow issue. 2018-10-31 11:07:53 +08:00
BaseCryptLib.inf CryptoPkg: Removing ipf which is no longer supported from edk2. 2018-09-25 23:40:41 +08:00
BaseCryptLib.uni CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00
InternalCryptLib.h CryptoPkg: Add extra build option to disable VS build warning 2017-03-29 16:15:19 +08:00
PeiCryptLib.inf CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00
PeiCryptLib.uni CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00
RuntimeCryptLib.inf CryptoPkg: Removing ipf which is no longer supported from edk2. 2018-09-25 23:40:41 +08:00
RuntimeCryptLib.uni CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00
SmmCryptLib.inf CryptoPkg: Removing ipf which is no longer supported from edk2. 2018-09-25 23:40:41 +08:00
SmmCryptLib.uni CryptoPkg: Clean up source files 2018-06-28 11:19:40 +08:00