diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2023-03-03 18:35:53 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-03-21 05:52:23 +0000 |
commit | 494127613b36e870250649b02cd4ce5f1969d9bd (patch) | |
tree | 21876f8b9d196c95fc5d880595442df3f132a557 /UefiCpuPkg | |
parent | b7a8264ae4704f781e70cc44dafdf07e4e5e690a (diff) | |
download | edk2-494127613b36e870250649b02cd4ce5f1969d9bd.tar.gz edk2-494127613b36e870250649b02cd4ce5f1969d9bd.tar.bz2 edk2-494127613b36e870250649b02cd4ce5f1969d9bd.zip |
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>
Diffstat (limited to 'UefiCpuPkg')
0 files changed, 0 insertions, 0 deletions