linux-stable/drivers/firmware
Tim Schumacher f33255ccbb 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:59:00 +02:00
..
arm_scmi firmware: arm_scmi: Fix device node validation for mailbox transport 2023-04-05 11:23:42 +02:00
broadcom
efi efivarfs: Request at most 512 bytes for variable names 2024-04-13 12:59:00 +02:00
google firmware: coreboot: framebuffer: Ignore reserved pixel color bits 2023-03-11 16:39:54 +01:00
imx
meson firmware: meson_sm: populate platform devices from sm device tree data 2024-01-25 14:37:44 -08:00
psci
smccc
tegra firmware: tegra: Fix error check return value of debugfs_create_file() 2022-08-21 15:15:31 +02:00
xilinx firmware: xilinx: don't make a sleepable memory allocation from an atomic context 2023-03-22 13:30:03 +01:00
arm_scpi.c firmware: arm_scpi: Ensure scpi_info is not assigned if the probe fails 2022-08-21 15:16:17 +02:00
arm_sdei.c arm64: sdei: abort running SDEI handlers during crash 2023-09-19 12:20:28 +02:00
dmi-id.c
dmi-sysfs.c firmware: dmi-sysfs: Fix memory leak in dmi_sysfs_register_handle 2022-06-14 18:32:34 +02:00
dmi_scan.c
edd.c
iscsi_ibft.c
iscsi_ibft_find.c
Kconfig ACPI: APEI: explicit init of HEST and GHES in apci_init() 2023-09-19 12:20:28 +02:00
Makefile
memmap.c
pcdp.c
pcdp.h
qcom_scm-legacy.c
qcom_scm-smc.c
qcom_scm.c firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit 2023-11-28 16:54:57 +00:00
qcom_scm.h
qemu_fw_cfg.c
raspberrypi.c firmware: raspberrypi: Introduce devm_rpi_firmware_get() 2023-05-17 11:48:02 +02:00
scpi_pm_domain.c
stratix10-rsu.c
stratix10-svc.c firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe 2023-09-19 12:20:03 +02:00
ti_sci.c firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create() 2024-01-25 14:37:44 -08:00
ti_sci.h
trusted_foundations.c
turris-mox-rwtm.c