linux-stable/drivers/firmware/efi
Rasmus Villemoes 942859d969 efi: cper: fix snprintf() use in cper_dimm_err_location()
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>
2021-05-22 14:05:37 +02:00
..
libstub efi/libstub: prevent read overflow in find_file_option() 2021-05-22 14:05:32 +02:00
test efi/efi_test: read RuntimeServicesSupported 2020-12-09 08:37:27 +01:00
apple-properties.c efi/apple-properties: Reinstate support for boolean properties 2020-12-31 10:28:53 +01:00
arm-runtime.c
capsule-loader.c
capsule.c efi: capsule: clean scatter-gather entries from the D-cache 2020-12-09 08:37:27 +01:00
cper-arm.c
cper-x86.c x86/mce, cper: Pass x86 CPER through the MCA handling chain 2020-11-21 12:05:41 +01:00
cper.c efi: cper: fix snprintf() use in cper_dimm_err_location() 2021-05-22 14:05:37 +02:00
dev-path-parser.c
earlycon.c
efi-bgrt.c
efi-init.c driver core: Delete pointless parameter in fwnode_operations.add_links 2020-12-09 19:14:48 +01:00
efi-pstore.c
efi.c firmware/efi: Fix a use after bug in efi_mem_reserve_persistent 2021-03-19 07:44:27 +01:00
efibc.c
efivars.c
embedded-firmware.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
esrt.c
fake_mem.c
fake_mem.h
fdtparams.c efi/fdt: fix panic when no valid fdt found 2021-05-22 14:03:42 +02:00
Kconfig EFI updates collected by Ard Biesheuvel: 2020-12-24 12:40:07 -08:00
Makefile efi: ia64: disable the capsule loader 2020-12-14 16:24:19 +01:00
memattr.c efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared 2021-05-22 14:05:13 +02:00
memmap.c
mokvar-table.c
rci2-table.c
reboot.c
riscv-runtime.c
runtime-map.c
runtime-wrappers.c
tpm.c
vars.c efivars: respect EFI_UNSUPPORTED return from firmware 2021-03-17 09:40:24 +01:00
x86_fake_mem.c