linux-stable/drivers/firmware
Tim Schumacher a7bd7dbaa2 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>
[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-04-13 12:50:10 +02:00
..
arm_scmi firmware: arm_scmi: Fix device node validation for mailbox transport 2023-04-05 11:15:42 +02:00
broadcom
efi efivarfs: Request at most 512 bytes for variable names 2024-04-13 12:50:10 +02:00
google firmware: coreboot: framebuffer: Ignore reserved pixel color bits 2023-03-11 16:31:48 +01:00
meson
tegra
Kconfig
Makefile
arm_scpi.c firmware: arm_scpi: Ensure scpi_info is not assigned if the probe fails 2022-08-25 11:15:33 +02:00
arm_sdei.c firmware: arm_sdei: Fix sleep from invalid context BUG 2023-05-30 12:42:08 +01:00
dcdbas.c
dcdbas.h
dell_rbu.c
dmi-id.c
dmi-sysfs.c firmware: dmi-sysfs: Fix memory leak in dmi_sysfs_register_handle 2022-06-14 16:59:33 +02:00
dmi_scan.c
edd.c
iscsi_ibft.c
iscsi_ibft_find.c
memmap.c
pcdp.c
pcdp.h
psci.c arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit() 2022-03-11 10:15:11 +01:00
psci_checker.c firmware/psci: fix application of sizeof to pointer 2021-11-26 11:35:57 +01:00
qcom_scm-32.c
qcom_scm-64.c
qcom_scm.c firmware: qcom_scm: Clear download bit during reboot 2023-05-17 11:13:09 +02:00
qcom_scm.h
qemu_fw_cfg.c firmware: qemu_fw_cfg: fix kobject leak in probe error path 2022-01-27 09:04:14 +01:00
raspberrypi.c
scpi_pm_domain.c firmware: arm_scpi: Fix string overflow in SCPI genpd driver 2021-12-22 09:19:04 +01:00
ti_sci.c firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create() 2024-01-25 14:33:33 -08:00
ti_sci.h