Re: [PATCH] efivarfs: Iterate variables with increasing name buffer sizes

From: Ard Biesheuvel
Date: Tue Jan 23 2024 - 06:24:40 EST


On Tue, 23 Jan 2024 at 00:15, Tim Schumacher <timschumi@xxxxxx> wrote:
>
> This sidesteps a quirk in a few old (2011-ish) UEFI implementations,
> where a call to `GetNextVariableName` with a buffer size larger than 512
> bytes will always return `EFI_INVALID_PARAMETER`.
>
> It is currently unknown whether this is just a botched check or if the
> length is interpreted differently, so the underlying buffer is still
> sized for 1024 bytes, even if we communicate a smaller size to the
> runtime service.
>
> Cc: stable@xxxxxxxxxxxxxxx # 6.1+
> Signed-off-by: Tim Schumacher <timschumi@xxxxxx>

Hello Tim,

I wonder if we might just reduce this to 512 and be done with it.
Presumably, Windows boots fine in UEFI mode on these machines, which
suggests that it passes a value <= 512 too, and I don't recall ever
encountering systems using extremely long variable names (i.e., longer
than 512 byte)