linux/fs/efivarfs
Tim Schumacher 249d6ca4ff efivarfs: Request at most 512 bytes for variable names
commit f45812cc23 upstream.

Work around 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.

There is some lore around EFI variable names being up to 1024 bytes in
size, but this has no basis in the UEFI specification, and the upper
bounds are typically platform specific, and apply to the entire variable
(name plus payload).

Given that Linux does not permit creating files with names longer than
NAME_MAX (255) bytes, 512 bytes (== 256 UTF-16 characters) is a
reasonable limit.

Cc: <stable@vger.kernel.org> # 6.1+
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-06 14:45:11 +00:00
..
file.c efivars: convert to fileattr 2021-04-12 15:04:29 +02:00
inode.c efivars: convert to fileattr 2021-04-12 15:04:29 +02:00
internal.h efi: vars: Move efivar caching layer into efivarfs 2022-06-24 20:40:19 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile efi: vars: Move efivar caching layer into efivarfs 2022-06-24 20:40:19 +02:00
super.c efivarfs: Free s_fs_info on unmount 2024-01-25 15:27:20 -08:00
vars.c efivarfs: Request at most 512 bytes for variable names 2024-03-06 14:45:11 +00:00