summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/QemuKernelLoaderFsDxe
diff options
context:
space:
mode:
authorTobin Feldman-Fitzthum <tobin@linux.ibm.com>2024-04-29 20:07:19 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-06-25 15:27:42 +0000
commit10b4bb8d6d0c515ed9663691aea3684be8f7b0fc (patch)
tree257b4d0f0f94c467b75401852a700406aa814a62 /OvmfPkg/QemuKernelLoaderFsDxe
parent56059941ec8c2f4d8fb126227b1154f8a869ac2b (diff)
downloadedk2-10b4bb8d6d0c515ed9663691aea3684be8f7b0fc.tar.gz
edk2-10b4bb8d6d0c515ed9663691aea3684be8f7b0fc.tar.bz2
edk2-10b4bb8d6d0c515ed9663691aea3684be8f7b0fc.zip
AmdSev: Halt on failed blob allocation
A malicious host may be able to undermine the fw_cfg interface such that loading a blob fails. In this case rather than continuing to the next boot option, the blob verifier should halt. For non-confidential guests, the error should be non-fatal. Signed-off-by: Tobin Feldman-Fitzthum <tobin@linux.ibm.com>
Diffstat (limited to 'OvmfPkg/QemuKernelLoaderFsDxe')
-rw-r--r--OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
index 3c12085f6c..cf58c97cd2 100644
--- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
+++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
@@ -1042,6 +1042,7 @@ QemuKernelLoaderFsDxeEntrypoint (
KERNEL_BLOB *CurrentBlob;
KERNEL_BLOB *KernelBlob;
EFI_STATUS Status;
+ EFI_STATUS FetchStatus;
EFI_HANDLE FileSystemHandle;
EFI_HANDLE InitrdLoadFile2Handle;
@@ -1060,15 +1061,13 @@ QemuKernelLoaderFsDxeEntrypoint (
//
for (BlobType = 0; BlobType < KernelBlobTypeMax; ++BlobType) {
CurrentBlob = &mKernelBlob[BlobType];
- Status = FetchBlob (CurrentBlob);
- if (EFI_ERROR (Status)) {
- goto FreeBlobs;
- }
+ FetchStatus = FetchBlob (CurrentBlob);
Status = VerifyBlob (
CurrentBlob->Name,
CurrentBlob->Data,
- CurrentBlob->Size
+ CurrentBlob->Size,
+ FetchStatus
);
if (EFI_ERROR (Status)) {
goto FreeBlobs;