Re: [RFC PATCH resend] x86/boot: Drop CRC-32 checksum and the build tool that generates it
From: H. Peter Anvin
Date: Tue Mar 11 2025 - 21:35:09 EST
On March 11, 2025 10:44:09 AM PDT, Ard Biesheuvel <ardb@xxxxxxxxxx> wrote:
>On Tue, 11 Mar 2025 at 18:29, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
>>
>> On March 11, 2025 10:25:15 AM PDT, Ard Biesheuvel <ardb@xxxxxxxxxx> wrote:
>> >On Tue, 11 Mar 2025 at 18:14, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
>> >>
>> >> >Ard Biesheuvel <ardb+git@xxxxxxxxxx> writes:
>> >> >
>> >...
>> >> >> it seems quite unlikely that this checksum is being used, so let's just
>> >> >> drop it, along with the tool that generates it.
>> >> >>
>> >> >> Instead, use simple file concatenation and truncation to combine the two
>> >> >> pieces into bzImage, and replace the checks on the size of the setup
>> >> >> block with a couple of ASSERT()s in the linker script.
>> >> >>
>> >...
>> >>
>> >> Please leave the bytes in question as explicit zeroes if possible.
>> >
>> >Keeping the
>> >
>> >. = ALIGN(. + 4, 0x200);
>> >
>> >in arch/x86/boot/compressed/vmlinux.lds.S should be sufficient to
>> >guarantee that the last 4 bytes of the file are zero, so it is quite
>> >trivial to implement. However, I'm not quite sure what purpose that
>> >would serve: could you elaborate?
>>
>> It means if someone *does* care it will be easier for them to adjust.
>
>I.e., someone can always stick a CRC-32 into the last 4 bytes if they
>wanted to? Yeah that makes sense.
Yes, or something can look for all zero and know it doesn't mean anything.