]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Dec 2018 08:26:32 +0000 (09:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Dec 2018 08:26:32 +0000 (09:26 +0100)
added patches:
kdb-use-memmove-instead-of-overlapping-memcpy.patch

queue-4.14/kdb-use-memmove-instead-of-overlapping-memcpy.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/kdb-use-memmove-instead-of-overlapping-memcpy.patch b/queue-4.14/kdb-use-memmove-instead-of-overlapping-memcpy.patch
new file mode 100644 (file)
index 0000000..9648aed
--- /dev/null
@@ -0,0 +1,43 @@
+From 2cf2f0d5b91fd1b06a6ae260462fc7945ea84add Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Fri, 2 Feb 2018 15:59:40 +0100
+Subject: kdb: use memmove instead of overlapping memcpy
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+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 |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/kernel/debug/kdb/kdb_support.c
++++ b/kernel/debug/kdb/kdb_support.c
+@@ -129,13 +129,13 @@ int kdbnearsym(unsigned long addr, kdb_s
+               }
+               if (i >= ARRAY_SIZE(kdb_name_table)) {
+                       debug_kfree(kdb_name_table[0]);
+-                      memcpy(kdb_name_table, kdb_name_table+1,
++                      memmove(kdb_name_table, kdb_name_table+1,
+                              sizeof(kdb_name_table[0]) *
+                              (ARRAY_SIZE(kdb_name_table)-1));
+               } else {
+                       debug_kfree(knt1);
+                       knt1 = kdb_name_table[i];
+-                      memcpy(kdb_name_table+i, kdb_name_table+i+1,
++                      memmove(kdb_name_table+i, kdb_name_table+i+1,
+                              sizeof(kdb_name_table[0]) *
+                              (ARRAY_SIZE(kdb_name_table)-i-1));
+               }
index b01463e70ba4c4c620791fd642ba83081b596177..2bc124e7a7db93b2dccd062b36106a1fcfad35ef 100644 (file)
@@ -9,3 +9,4 @@ ip_tunnel-fix-name-string-concatenate-in-__ip_tunnel_create.patch
 drm-gma500-fix-logic-error.patch
 scsi-bfa-convert-to-strlcpy-strlcat.patch
 staging-rts5208-fix-gcc-8-logic-error-warning.patch
+kdb-use-memmove-instead-of-overlapping-memcpy.patch