Re: [RFC] efi: variable name size limit in efivar_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(cc Matthew and Peter)

On Wed, 17 Mar 2021 at 08:35, Heinrich Schuchardt <xypron.glpk@xxxxxx> wrote:
>
>
> Hello Ard,
>
> in efivar_init() I read:
>
>          /*
>           * Per EFI spec, the maximum storage allocated for both
>           * the variable name and variable data is 1024 bytes.
>           */
>
>          do {
>                  variable_name_size = 1024;
>
> This dates back at least to Linux 2.5.0 of 23-Nov-2001 where in
> arch/ia64/kernel/efivars.c we have:
>
> /*
>   * The maximum size of VariableName + Data = 1024
>   * Therefore, it's reasonable to save that much
>   * space in each part of the structure,
>   * and we use a page for reading/writing.
>   */
>
> I cannot find this 1024 byte size limit neither in UEFI spec 2.8B nor in
> EFI spec 1.1.
>
> Variable d719b2cb-3d3a-4596-a3bc-dad00e67656f-db has 5080 bytes of data
> on my laptop.
>
> It may not reasonable to use a variable name exceeding 512 UTF-16
> characters. But shouldn't we handle this case gracefully in efivar_init()?
>

This predates my involvement in EFI by a long time, so I've cc'ed
Peter and Matthew, who may be able to shed some light on this.



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux