From 1111e9fe7078eed9e5c50e1808776ee40a629e16 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 16 Jan 2025 15:52:54 +0100
Subject: [PATCH 04/10] OvmfPkg/QemuKernelLoaderFsDxe: drop bogus assert

Triggers when trying to get root directory info.
Reproducer:
 * Use qemu -kernel with something edk2 can not load.
 * When dropped into the efi shell try inspect the file system.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

CVE: CVE-2025-2296
Upstream-Status: Backport [https://github.com/tianocore/edk2/commit/1111e9fe7078eed9e5c50e1808776ee40a629e16]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
index 0947b6bf2d..3e1a876bf0 100644
--- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
+++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
@@ -290,7 +290,6 @@ QemuKernelBlobTypeToFileInfo (
 
   NameSize     = (StrLen (Name) + 1) * 2;
   FileInfoSize = OFFSET_OF (EFI_FILE_INFO, FileName) + NameSize;
-  ASSERT (FileInfoSize >= sizeof *FileInfo);
 
   OriginalBufferSize = *BufferSize;
   *BufferSize        = FileInfoSize;
-- 
2.49.0

