Skip to content

Commit

Permalink
SecurityPkg/DxeImageVerificationLib: tighten default result (CVE-2019…
Browse files Browse the repository at this point in the history
…-14575)

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1608

All intermediate results inside this function will be checked and
returned immediately upon any failure or error, like out-of-resource,
hash calculation error or certificate retrieval failure.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
  • Loading branch information
Jian J Wang authored and mergify[bot] committed Feb 19, 2020
1 parent a83dbf0 commit 5cd8be6
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ IsForbiddenByDbx (
//
// Variable Initialization
//
IsForbidden = FALSE;
IsForbidden = TRUE;
Data = NULL;
CertList = NULL;
CertData = NULL;
Expand All @@ -1257,7 +1257,14 @@ IsForbiddenByDbx (
//
DataSize = 0;
Status = gRT->GetVariable (EFI_IMAGE_SECURITY_DATABASE1, &gEfiImageSecurityDatabaseGuid, NULL, &DataSize, NULL);
ASSERT (EFI_ERROR (Status));
if (Status != EFI_BUFFER_TOO_SMALL) {
if (Status == EFI_NOT_FOUND) {
//
// Evidently not in dbx if the database doesn't exist.
//
IsForbidden = FALSE;
}
return IsForbidden;
}
Data = (UINT8 *) AllocateZeroPool (DataSize);
Expand Down Expand Up @@ -1374,6 +1381,8 @@ IsForbiddenByDbx (

}

IsForbidden = FALSE;

Done:
if (Data != NULL) {
FreePool (Data);
Expand Down

0 comments on commit 5cd8be6

Please sign in to comment.