]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/boot: Add back some padding for the CRC-32 checksum
authorArd Biesheuvel <ardb@kernel.org>
Wed, 12 Mar 2025 08:12:05 +0000 (09:12 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 12 Mar 2025 12:04:52 +0000 (13:04 +0100)
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" <hpa@zytor.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ian Campbell <ijc@hellion.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250312081204.521411-2-ardb+git@google.com
arch/x86/boot/compressed/vmlinux.lds.S

index 48d0b51845571e7ebaf8a42016c84a3d797eebe2..3b2bc61c9408e8387bb951de8488a06f08b766a1 100644 (file)
@@ -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);