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

[xen stable-4.21] EFI: Fix relocating ESRT for dom0



commit 99bd17462dd4b7366bd40d33ffee119d21799da8
Author:     Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Wed Mar 4 14:47:59 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Mar 4 14:47:59 2026 +0100

    EFI: Fix relocating ESRT for dom0
    
    Fix calculating the table size - it consists of a header + entries, not
    just entries.
    This bug caused the last entry to have garbage in its final fields,
    including LowestSupportedFwVersion and CapsuleFlags, which (usually)
    made fwupd able to detect firmware update availability, but refuse
    actually installing it.
    
    Fixes: dc7da0874ba4 ("EFI: preserve the System Resource Table for dom0")
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
    Acked-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
    master commit: 3ea44aa78c8170ca8010a89d24717d6f6ccfe564
    master date: 2026-02-12 11:35:05 +0100
---
 xen/common/efi/boot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index d7f4d0cb22..2047d58e39 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -675,7 +675,8 @@ static size_t __init get_esrt_size(const 
EFI_MEMORY_DESCRIPTOR *desc)
     if ( esrt_ptr->FwResourceCount > available_len / 
sizeof(esrt_ptr->Entries[0]) )
         return 0;
 
-    return esrt_ptr->FwResourceCount * sizeof(esrt_ptr->Entries[0]);
+    return offsetof(EFI_SYSTEM_RESOURCE_TABLE,
+                    Entries[esrt_ptr->FwResourceCount]);
 }
 
 static EFI_GUID __initdata esrt_guid = EFI_SYSTEM_RESOURCE_TABLE_GUID;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21



 


Rackspace

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