1
0
Fork 0
remarkable-linux/arch/s390
Vasily Gorbik a838008bb1 s390/extmem: fix gcc 8 stringop-overflow warning
[ Upstream commit 6b2ddf33ba ]

arch/s390/mm/extmem.c: In function '__segment_load':
arch/s390/mm/extmem.c:436:2: warning: 'strncat' specified bound 7 equals
source length [-Wstringop-overflow=]
  strncat(seg->res_name, " (DCSS)", 7);

What gcc complains about here is the misuse of strncat function, which
in this case does not limit a number of bytes taken from "src", so it is
in the end the same as strcat(seg->res_name, " (DCSS)");

Keeping in mind that a res_name is 15 bytes, strncat in this case
would overflow the buffer and write 0 into alignment byte between the
fields in the struct. To avoid that increasing res_name size to 16,
and reusing strlcat.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-03 17:00:50 -07:00
..
appldata License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
boot License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
configs s390: fix zfcpdump-config 2017-10-16 08:19:01 +02:00
crypto s390/crypto: Fix return code checking in cbc_paes_crypt() 2018-09-26 08:38:06 +02:00
hypfs hypfs_kill_super(): deal with failed allocations 2018-04-24 09:36:38 +02:00
include s390/qdio: reset old sbal_state flags 2018-09-05 09:26:40 +02:00
kernel s390/sysinfo: add missing #ifdef CONFIG_PROC_FS 2018-10-03 17:00:49 -07:00
kvm KVM: s390: vsie: copy wrapping keys to right place 2018-09-19 22:43:36 +02:00
lib s390/lib: use expoline for all bcr instructions 2018-09-15 09:45:36 +02:00
mm s390/extmem: fix gcc 8 stringop-overflow warning 2018-10-03 17:00:50 -07:00
net s390: fix br_r1_trampoline for machines without exrl 2018-09-05 09:26:40 +02:00
numa s390/numa: move initial setup of node_to_cpumask_map 2018-09-05 09:26:40 +02:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci s390/pci: fix out of bounds access during irq setup 2018-09-05 09:26:40 +02:00
tools License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kbuild s390/crypto: Provide s390 specific arch random functionality. 2017-04-26 13:41:35 +02:00
Kconfig s390: add sysfs attributes for spectre 2018-04-29 11:33:15 +02:00
Kconfig.debug License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile s390: add automatic detection of the spectre defense 2018-04-29 11:33:15 +02:00
defconfig s390: update defconfig 2017-06-08 15:53:48 +02:00