aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/arm-runtime.c
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2021-04-21 21:46:36 +0200
committerArd Biesheuvel <ardb@kernel.org>2021-05-22 14:05:37 +0200
commit942859d969de7f6f7f2659a79237a758b42782da (patch)
treea49a607f9725836b719f1054870d4503b2380a65 /drivers/firmware/efi/arm-runtime.c
parentefi/libstub: prevent read overflow in find_file_option() (diff)
downloadlinux-dev-942859d969de7f6f7f2659a79237a758b42782da.tar.xz
linux-dev-942859d969de7f6f7f2659a79237a758b42782da.zip
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: 3760cd20402d4 ("CPER: Adjust code flow of some functions") Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/arm-runtime.c')
0 files changed, 0 insertions, 0 deletions