kernel_samsung_a53x/drivers/firmware
Tim Schumacher 1c74202782 efivarfs: Request at most 512 bytes for variable names
commit f45812cc23fb74bef62d4eb8a69fe7218f4b9f2a 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>
[timschumi@gmx.de: adjusted diff for changed context and code move]
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 09:22:41 +01:00
..
arm_scmi
broadcom
efi efivarfs: Request at most 512 bytes for variable names 2024-11-19 09:22:41 +01:00
google Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imx
meson firmware: meson_sm: populate platform devices from sm device tree data 2024-11-18 12:12:28 +01:00
psci
smccc
tegra Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xilinx
arm_scpi.c
arm_sdei.c
dmi-id.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dmi-sysfs.c
dmi_scan.c
edd.c
iscsi_ibft.c
iscsi_ibft_find.c
Kconfig
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
memmap.c
pcdp.c
pcdp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qcom_scm-legacy.c
qcom_scm-smc.c
qcom_scm.c
qcom_scm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qemu_fw_cfg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
raspberrypi.c
scpi_pm_domain.c
stratix10-rsu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stratix10-svc.c
ti_sci.c
ti_sci.h
trusted_foundations.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
turris-mox-rwtm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00