android_kernel_xiaomi_sdm845/drivers/firmware
Rasmus Villemoes fc0138fa0c efi: cper: fix snprintf() use in cper_dimm_err_location()
[ Upstream commit 942859d969de7f6f7f2659a79237a758b42782da ]

snprintf() should be given the full buffer size, not one less. And it
guarantees nul-termination, so doing it manually afterwards is
pointless.

It's even potentially harmful (though probably not in practice because
CPER_REC_LEN is 256), due to the "return how much would have been
written had the buffer been big enough" semantics. I.e., if the bank
and/or device strings are long enough that the "DIMM location ..."
output gets truncated, writing to msg[n] is a buffer overflow.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Fixes: 3760cd2040 ("CPER: Adjust code flow of some functions")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-10 12:42:35 +02:00
..
broadcom tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
efi efi: cper: fix snprintf() use in cper_dimm_err_location() 2021-06-10 12:42:35 +02:00
google gsmi: Fix bug in append_to_eventlog sysfs handler 2019-11-28 18:28:21 +01:00
meson firmware: Amlogic: Add secure monitor driver 2016-09-01 14:23:39 -07:00
arm_scpi.c firmware: arm_scpi: add missing of_node_put after calling of_parse_phandle 2016-08-08 14:31:09 +01:00
dcdbas.c dcdbas: Make use of smp_call_on_cpu() 2016-09-05 13:52:40 +02:00
dcdbas.h
dell_rbu.c
dmi_scan.c firmware: dmi_scan: Fix handling of empty DMI strings 2018-05-30 07:50:24 +02:00
dmi-id.c dmi-id: don't free dev structure after calling device_register 2016-09-08 10:35:50 +02:00
dmi-sysfs.c
edd.c
iscsi_ibft_find.c
iscsi_ibft.c iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND 2019-08-25 10:51:23 +02:00
Kconfig firmware: qcom-scm: Fix QCOM_SCM configuration 2021-05-22 10:40:24 +02:00
Makefile firmware: Amlogic: Add secure monitor driver 2016-09-01 14:23:39 -07:00
memmap.c
pcdp.c
pcdp.h
psci.c firmware/psci: Expose SMCCC version through psci_ops 2018-04-20 08:21:05 +02:00
qcom_scm-32.c firmware: qcom: scm: Expose PAS command 10 as reset-controller 2016-06-24 22:53:52 -05:00
qcom_scm-64.c firmware: qcom: scm: Ensure 'a0' status code is treated as signed 2019-12-21 10:42:17 +01:00
qcom_scm.c firmware: qcom_scm: make it explicitly non-modular 2016-08-23 15:46:32 -05:00
qcom_scm.h firmware: qcom: scm: Expose PAS command 10 as reset-controller 2016-06-24 22:53:52 -05:00
qemu_fw_cfg.c driver core update for 4.7-rc1 2016-05-20 21:26:15 -07:00
raspberrypi.c
scpi_pm_domain.c firmware: scpi: add device power domain support using genpd 2016-06-21 10:26:51 +01:00