linux/arch/s390/mm
Vasily Gorbik 6b2ddf33ba s390/extmem: fix gcc 8 stringop-overflow warning
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>
2018-07-02 11:24:50 +02:00
..
cmm.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-30 08:13:36 -08:00
dump_pagetables.c s390: unify linker symbols usage 2018-02-27 08:05:23 +01:00
extmem.c s390/extmem: fix gcc 8 stringop-overflow warning 2018-07-02 11:24:50 +02:00
fault.c signal/s390: Use force_sig_fault where appropriate 2018-04-25 10:44:08 -05:00
gmap.c KVM: s390: Add storage key facility interpretation control 2018-05-17 09:00:41 +02:00
gup.c mm/gup.c: document return value 2018-04-13 17:10:27 -07:00
hugetlbpage.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
init.c mm: pass the vmem_altmap to arch_remove_memory and __remove_pages 2018-01-08 11:46:23 -08:00
maccess.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem_detect.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmap.c exec: pass stack rlimit into mm layout functions 2018-04-11 10:28:37 -07:00
page-states.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pageattr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pgalloc.c s390: use _refcount for pgtables 2018-06-07 17:34:37 -07:00
pgtable.c KVM: s390: Add storage key facility interpretation control 2018-05-17 09:00:41 +02:00
vmem.c mm: pass the vmem_altmap to vmemmap_free 2018-01-08 11:46:23 -08:00