audk/SecurityPkg
Gerd Hoffmann 494127613b SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2
Call gRT->GetVariable() directly to read the SecureBoot variable.  It is
one byte in size so we can easily place it on the stack instead of
having GetEfiGlobalVariable2() allocate it for us, which avoids a few
possible error cases.

Skip secure boot checks if (and only if):

 (a) the SecureBoot variable is not present (EFI_NOT_FOUND) according to
     the return value, or
 (b) the SecureBoot variable was read successfully and is set to
     SECURE_BOOT_MODE_DISABLE.

Previously the code skipped the secure boot checks on *any*
gRT->GetVariable() error (GetEfiGlobalVariable2 sets the variable
value to NULL in that case) and also on memory allocation failures.

Fixes: CVE-2019-14560
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=2167
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Suggested-by: Marvin Häuser <mhaeuser@posteo.de>
Reviewed-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2023-03-21 05:52:23 +00:00
..
EnrollFromDefaultKeysApp SecurityPkg: Secure Boot Drivers: Added common header files 2022-07-07 01:07:00 +00:00
FvReportPei SecurityPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Hash2DxeCrypto SecurityPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
HddPassword SecurityPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Include SecurityPkg: deprecate RpmcLib and VariableKeyLib 2022-12-21 05:49:48 +00:00
Library SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2 2023-03-21 05:52:23 +00:00
Pkcs7Verify/Pkcs7VerifyDxe SecurityPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
RandomNumberGenerator/RngDxe SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL 2023-03-07 15:34:23 +00:00
Tcg SecurityPkg/TdTcg2Dxe: td-guest shall halt when CcMeasurement install fail 2023-02-04 12:30:47 +00:00
Test SecurityPkg: SecureBootVariableLib: Added unit tests 2022-07-07 01:07:00 +00:00
VariableAuthenticated SecurityPkg: SecureBootConfigDxe: Updated invocation pattern 2022-07-07 01:07:00 +00:00
SecurityPkg.ci.yaml SecurityPkg: SecureBootVariableLib: Added unit tests 2022-07-07 01:07:00 +00:00
SecurityPkg.dec SecurityPkg: don't require PK to be self-signed by default 2023-02-04 11:53:59 +00:00
SecurityPkg.dsc SecurityPkg: Move TdTcg2Dxe from OvmfPkg to SecurityPkg 2023-01-06 09:55:14 +00:00
SecurityPkg.uni SecurityPkg: Fix spelling errors 2019-10-23 10:23:23 -07:00
SecurityPkgExtra.uni SecurityPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:23 -07:00