[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/EFI: guard against oversized modules



commit f19e7f471ea1659bb960730a8e61017da4147364
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon Nov 9 11:33:14 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Nov 9 11:33:14 2026 +0100

    x86/EFI: guard against oversized modules
    
    module_t's mod_end field (which we repurpose to hold a module's size)
    cannot hold values 4Gb and up. Don't let truncation go silently.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: George Dunlap <gwd@xxxxxxxxxxxxxx>
    Acked-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
---
 xen/arch/x86/efi/efi-boot.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index d738b839ee..757b2b529b 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -736,6 +736,13 @@ static void __init efi_arch_handle_module(const struct 
file *file,
     place_string(&mb_modules[mbi.mods_count].string, local_name.s);
     mb_modules[mbi.mods_count].mod_start = file->addr >> PAGE_SHIFT;
     mb_modules[mbi.mods_count].mod_end = file->size;
+
+    if ( mb_modules[mbi.mods_count].mod_end != file->size )
+    {
+        PrintStr(name);
+        blexit(L" is too large");
+    }
+
     ++mbi.mods_count;
     efi_bs->FreePool(ptr);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.