kdb: use memmove instead of overlapping memcpy
authorArnd Bergmann <arnd@arndb.de>
Fri, 2 Feb 2018 14:59:40 +0000 (15:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Dec 2018 08:22:29 +0000 (09:22 +0100)
commitb02e5ce46cdc71ce8675ff62c35040309439a882
tree7ffd5adf603b19ad171944298ad4e88b15015cf3
parent9b72f39ce66893520a9201ce618d8adfc63a07e7
kdb: use memmove instead of overlapping memcpy

commit 2cf2f0d5b91fd1b06a6ae260462fc7945ea84add upstream.

gcc discovered that the memcpy() arguments in kdbnearsym() overlap, so
we should really use memmove(), which is defined to handle that correctly:

In function 'memcpy',
    inlined from 'kdbnearsym' at /git/arm-soc/kernel/debug/kdb/kdb_support.c:132:4:
/git/arm-soc/include/linux/string.h:353:9: error: '__builtin_memcpy' accessing 792 bytes at offsets 0 and 8 overlaps 784 bytes at offset 8 [-Werror=restrict]
  return __builtin_memcpy(p, q, size);

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/debug/kdb/kdb_support.c