projects/linux·commit e471a86a

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

e471a86a · Ard Biesheuvel <[email protected]> · 2025-03-12 09:12:05 +01:00

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.

[ mingo: Added the 'obsolete' qualifier to the comment. ]

Suggested-by: "H. Peter Anvin" <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Cc: Ian Campbell <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Commit
e471a86a8c523eccdfd1c4745ed7ac7cbdcc1f3f
Parents
9c54baab

Changes

1 files changed · +2 −1

FileStatusAddDelContent
arch/x86/boot/compressed/vmlinux.lds.Smodified+2−1View file

arch/x86/boot/compressed/vmlinux.lds.S

View file
diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index 48d0b51..3b2bc61 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 the obsolete CRC-32 checksum */
+ . = ALIGN(. + 4, 0x200);
_edata = . ;
}
. = ALIGN(L1_CACHE_BYTES);