[PATCH] x86/boot: Add back some padding for the CRC-32 checksum

From: Ard Biesheuvel
Date: Wed Mar 12 2025 - 04:12:20 EST


From: Ard Biesheuvel <ardb@xxxxxxxxxx>

Even though no uses of the bzImage CRC-32 checksum are known, ensure
that the last 4 bytes of the image are unused zero bytes, so that the
checksum can be generated post-build if needed.

Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
---
As requested by hpa, this applies onto today's tip/x86/build

arch/x86/boot/compressed/vmlinux.lds.S | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index 48d0b5184557..083ec6d7722a 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -48,7 +48,8 @@ SECTIONS
*(.data)
*(.data.*)

- . = ALIGN(0x200);
+ /* Add 4 bytes of extra space for a CRC-32 checksum */
+ . = ALIGN(. + 4, 0x200);
_edata = . ;
}
. = ALIGN(L1_CACHE_BYTES);
--
2.49.0.rc0.332.g42c0ae87b1-goog