]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
kdb: use memmove instead of overlapping memcpy
authorArnd Bergmann <arnd@arndb.de>
Fri, 2 Feb 2018 14:59:40 +0000 (15:59 +0100)
committerSultan Alsawaf <sultan.alsawaf@canonical.com>
Wed, 24 Jul 2019 15:45:01 +0000 (09:45 -0600)
commit16796b1565f51fe42a8a82fd6163838ba76a148b
tree1a923e8848de3bc71562f9f7dbc0a162c082ce68
parentff0ca7e8fd8b52b5e35cd7fb7d0153d3ce01ad54
kdb: use memmove instead of overlapping memcpy

BugLink: https://bugs.launchpad.net/bugs/1837161
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>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
kernel/debug/kdb/kdb_support.c