mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/boot: Add back some padding for the CRC-32 checksum
@ 2025-03-12  8:12 Ard Biesheuvel
  2025-03-12 12:09 ` [tip: x86/build] " tip-bot2 for Ard Biesheuvel
  0 siblings, 1 reply; 7+ messages in thread
From: Ard Biesheuvel @ 2025-03-12  8:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, hpa, mingo, Ard Biesheuvel

From: Ard Biesheuvel <ardb@kernel.org>

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@kernel.org>
---
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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-15 21:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-12  8:12 [PATCH] x86/boot: Add back some padding for the CRC-32 checksum Ard Biesheuvel
2025-03-12 12:09 ` [tip: x86/build] " tip-bot2 for Ard Biesheuvel
2025-04-14 13:56   ` Borislav Petkov
2025-04-14 14:07     ` Ard Biesheuvel
2025-04-15 17:00       ` H. Peter Anvin
2025-04-15 21:54         ` Borislav Petkov
2025-04-15 21:58           ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®