diff options
author | Tim Schumacher <timschumi@gmx.de> | 2024-03-28 21:50:33 +0100 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2024-04-13 10:33:02 +0200 |
commit | cda30c6542c8bb445bc84f6616cac8d012547f0a (patch) | |
tree | faced30502e21da512704a6c6e1c79f947ac86f3 /include/linux/efi.h | |
parent | 89ea21d70d9c9968dfd10c7e30520d0f03d465c2 (diff) | |
download | lwn-cda30c6542c8bb445bc84f6616cac8d012547f0a.tar.gz lwn-cda30c6542c8bb445bc84f6616cac8d012547f0a.zip |
efi: Clear up misconceptions about a maximum variable name size
The UEFI specification does not make any mention of a maximum variable
name size, so the headers and implementation shouldn't claim that one
exists either.
Comments referring to this limit have been removed or rewritten, as this
is an implementation detail local to the Linux kernel.
Where appropriate, the magic value of 1024 has been replaced with
EFI_VAR_NAME_LEN, as this is used for the efi_variable struct
definition. This in itself does not change any behavior, but should
serve as points of interest when making future changes in the same area.
A related build-time check has been added to ensure that the special
512 byte sized buffer will not overflow with a potentially decreased
EFI_VAR_NAME_LEN.
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'include/linux/efi.h')
-rw-r--r-- | include/linux/efi.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h index d59b0947fba0..418e555459da 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1072,12 +1072,11 @@ static inline u64 efivar_reserved_space(void) { return 0; } #endif /* - * 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. + * There is no actual upper limit specified for the variable name size. + * + * This limit exists only for practical purposes, since name conversions + * are bounds-checked and name data is occasionally stored in-line. */ - #define EFI_VAR_NAME_LEN 1024 int efivars_register(struct efivars *efivars, |