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: dc7da0874b ("EFI: preserve the System Resource Table for dom0")
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
This commit is contained in:
Marek Marczykowski-Górecki authored and Jan Beulich committed 2026-02-12 11:35:05 +01:00
1 parent 5513bfd054
commit 3ea44aa78c
1 file changed
+2 -1
+2 -1
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.