edk2/SecurityPkg/Library
Laszlo Ersek 0b143fa43e SecurityPkg/DxeImageVerificationLib: catch alignment overflow (CVE-2019-14562)
The DxeImageVerificationHandler() function currently checks whether
"SecDataDir" has enough room for "WinCertificate->dwLength". However, for
advancing "OffSet", "WinCertificate->dwLength" is aligned to the next
multiple of 8. If "WinCertificate->dwLength" is large enough, the
alignment will return 0, and "OffSet" will be stuck at the same value.

Check whether "SecDataDir" has room left for both
"WinCertificate->dwLength" and the alignment.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Wenyi Xie <xiewenyi2@huawei.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2215
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200901091221.20948-4-lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Wenyi Xie <xiewenyi2@huawei.com>
Reviewed-by: Min M Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2020-09-02 10:16:18 +00:00
..
AuthVariableLib SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
DxeImageAuthenticationStatusLib SecurityPkg/DxeImageAuth: Mark the File parameter as OPTIONAL 2020-04-22 01:55:34 +00:00
DxeImageVerificationLib SecurityPkg/DxeImageVerificationLib: catch alignment overflow (CVE-2019-14562) 2020-09-02 10:16:18 +00:00
DxeRsa2048Sha256GuidedSectionExtractLib SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
DxeTcg2PhysicalPresenceLib SecurityPkg: Change default value source 2020-05-21 15:48:57 +00:00
DxeTcgPhysicalPresenceLib SecurityPkg: Fix few typos 2020-02-10 22:30:07 +00:00
DxeTpm2MeasureBootLib SecurityPkg/TPM: measure UEFI images without associated device paths again 2020-04-22 01:55:34 +00:00
DxeTpmMeasureBootLib SecurityPkg/TPM: measure UEFI images without associated device paths again 2020-04-22 01:55:34 +00:00
DxeTpmMeasurementLib SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
FmpAuthenticationLibPkcs7 SecurityPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:23 -07:00
FmpAuthenticationLibRsa2048Sha256 SecurityPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:23 -07:00
HashInstanceLibSha1 SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
HashInstanceLibSha256 SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
HashInstanceLibSha384 SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
HashInstanceLibSha512 SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
HashInstanceLibSm3 SecurityPkg: introduce the SM3 digest algorithm 2019-07-19 14:31:52 +02:00
HashLibBaseCryptoRouter SecurityPkg: Fix few typos 2020-02-10 22:30:07 +00:00
HashLibTpm2 SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
PeiRsa2048Sha256GuidedSectionExtractLib SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
PeiTcg2PhysicalPresenceLib SecurityPkg: Change default value source 2020-05-21 15:48:57 +00:00
PeiTpmMeasurementLib SecurityPkg/PeiTpmMeasurementLib: Add PEI instance. 2020-07-23 01:31:43 +00:00
PlatformSecureLibNull SecurityPkg: Fix few typos 2020-02-10 22:30:07 +00:00
RpmcLibNull SecurityPkg: add null version of RpmcLib 2020-03-27 16:41:05 +00:00
SmmTcg2PhysicalPresenceLib SecurityPkg: Change default value source 2020-05-21 15:48:57 +00:00
Tcg2PpVendorLibNull SecurityPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:23 -07:00
TcgEventLogRecordLib SecurityPkg/TcgEventLogRecordLib: add new lib for firmware measurement 2020-08-26 15:56:11 +00:00
TcgPpVendorLibNull SecurityPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:23 -07:00
TcgStorageCoreLib SecurityPkg/Tcg: Fix various typos 2020-02-10 22:30:07 +00:00
TcgStorageOpalLib SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
Tpm2CommandLib SecurityPkg/Tpm2CommandLib: add a new function 2020-07-28 09:56:25 +00:00
Tpm2DeviceLibDTpm SecurityPkg/Library/Tpm: Fix various typos 2020-02-10 22:30:07 +00:00
Tpm2DeviceLibRouter SecurityPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:23 -07:00
Tpm2DeviceLibTcg2 SecurityPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:23 -07:00
Tpm12CommandLib SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
Tpm12DeviceLibDTpm SecurityPkg/Library/Tpm: Fix various typos 2020-02-10 22:30:07 +00:00
Tpm12DeviceLibTcg SecurityPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:23 -07:00
TpmCommLib SecurityPkg/Library/Tpm: Fix various typos 2020-02-10 22:30:07 +00:00
VariableKeyLibNull SecurityPkg: add null version of VariableKeyLib 2020-03-27 16:41:05 +00:00