[PATCH master 03/39] efi: loader: fix CRC32 computation in table header update
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Feb 16 00:44:03 PST 2026
The CRC32 is computed over the full table header, which includes the
crc32 field itself. Without zeroing the field first, the old CRC
value is included as input data in the new computation, producing
incorrect results on any update after the first.
The UEFI specification requires the field to be zero during CRC32
computation.
Co-Authored-By: Claude Opus 4.6 <noreply at anthropic.com>
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
efi/loader/table.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/efi/loader/table.c b/efi/loader/table.c
index 0c200365b835..dc2ec893cb2e 100644
--- a/efi/loader/table.c
+++ b/efi/loader/table.c
@@ -13,6 +13,7 @@
*/
void __efi_runtime efi_update_table_header_crc32(struct efi_table_hdr *table)
{
+ table->crc32 = 0;
table->crc32 = __pi_crc32(0, table, table->headersize);
}
--
2.47.3
More information about the barebox
mailing list