[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA6671C6-C1E3-4EFB-A63B-77542BE2BB3A@zytor.com>
Date: Tue, 15 Apr 2025 14:58:44 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Borislav Petkov <bp@...en8.de>
CC: Ard Biesheuvel <ardb@...nel.org>, linux-kernel@...r.kernel.org,
linux-tip-commits@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Ian Campbell <ijc@...lion.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>, x86@...nel.org
Subject: Re: [tip: x86/build] x86/boot: Add back some padding for the CRC-32 checksum
On April 15, 2025 2:54:27 PM PDT, Borislav Petkov <bp@...en8.de> wrote:
>On Tue, Apr 15, 2025 at 10:00:11AM -0700, H. Peter Anvin wrote:
>> >This was done on hpa's request - maybe he has a duration in mind for
>> >this grace period?
>>
>> I would prefer to leave it indefinitely, because an all zero pattern is far easier to detect than what would look like a false checksum.
>>
>> So I remembered eventually who wanted it: it was a direct from flash boot loader who wanted to detect a partial flash failure before invoking the kernel, so that it can redirect to a secondary kernel.
>
>What is a "direct from flash boot loader"?
>
>> That would obviously not be an UEFI environment, so the signing issue is not applicable.
>>
>> An all zero end field actually works for that purpose (although requires a boot loader patch), because an unprogrammed flash sector contains FFFFFFFF not 00000000.
>>
>> We have kept the bzImage format backwards compatible – sometimes at considerable effort – and the cost of reasonably continuing to do so is absolutely minimal. This is an incompatible change, so at least it is appropriate to give unambiguous indication thereof.
>>
>> In other words: it ain't broken, don't try to fix it. It is all downside, no upside.
>
>Sure but look at what is there now:
>
> /* Add 4 bytes of extra space for the obsolete CRC-32 checksum */
> . = ALIGN(. + 4, 0x200);
> _edata = . ;
>
>This basically screams at me: "delete me, delete me!" :-P
>
>So I would probably put the gist of what you say above as a comment there so
>that we have the rationale stated there, for future, trigger-happy
>generations.
>
>Thx.
>
It is an embedded boot loader that loads the kernel image from flash (either NAND or NOR), without a file system.
Powered by blists - more mailing lists