summaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2018-12-06 16:47:06 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2018-12-08 07:41:21 +0100
commitd4c05b67d3bb9380b481f662b214c68454ae464c (patch)
tree23d1988aa850fcaa346dc2d8fbdf6d910b37b85b /patches
parent6b4d8234c9c07c820de51fb9b6caf1e8ac3a9ac0 (diff)
downloadptxdist-d4c05b67d3bb9380b481f662b214c68454ae464c.tar.gz
ptxdist-d4c05b67d3bb9380b481f662b214c68454ae464c.tar.xz
mmc-utils: version bump 2016-06-07 -> 2018-03-27
- version bump - picked patch from linux-mmc ML to fix compilation with GCC 8 Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches')
-rw-r--r--patches/mmc-utils-2018-03-27-gb4fe0c8c0e57/0001-lsmmc-replace-strncpy-with-memmove-on-overlapping-me.patch34
-rw-r--r--patches/mmc-utils-2018-03-27-gb4fe0c8c0e57/series4
2 files changed, 38 insertions, 0 deletions
diff --git a/patches/mmc-utils-2018-03-27-gb4fe0c8c0e57/0001-lsmmc-replace-strncpy-with-memmove-on-overlapping-me.patch b/patches/mmc-utils-2018-03-27-gb4fe0c8c0e57/0001-lsmmc-replace-strncpy-with-memmove-on-overlapping-me.patch
new file mode 100644
index 000000000..858493d27
--- /dev/null
+++ b/patches/mmc-utils-2018-03-27-gb4fe0c8c0e57/0001-lsmmc-replace-strncpy-with-memmove-on-overlapping-me.patch
@@ -0,0 +1,34 @@
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 29 Mar 2018 01:19:14 -0700
+Subject: [PATCH] lsmmc: replace strncpy with memmove on overlapping memory
+ copy
+
+here source and destination addresses are overlapping so using memmove is
+going to be more efficient.
+
+Additionally, the bounded size for copy is overflowing for first copy
+
+In function 'strncpy',
+ inlined from 'read_file' at lsmmc.c:356:3:
+/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-gnueabi/mmc-utils/0.1-r0/recipe-sysroot/usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' accessing 4096 bytes at offsets 0 and 1 overlaps 4095 bytes at offset 1 [-Werror=restrict]
+ return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lsmmc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lsmmc.c b/lsmmc.c
+index c4faa002e780..bcb854daf3e1 100644
+--- a/lsmmc.c
++++ b/lsmmc.c
+@@ -353,7 +353,7 @@ char *read_file(char *name)
+ line[strlen(line) - 1] = '\0';
+
+ while (isspace(line[0]))
+- strncpy(&line[0], &line[1], sizeof(line));
++ memmove(&line[0], &line[1], sizeof(line)-1);
+
+ return strdup(line);
+ }
diff --git a/patches/mmc-utils-2018-03-27-gb4fe0c8c0e57/series b/patches/mmc-utils-2018-03-27-gb4fe0c8c0e57/series
new file mode 100644
index 000000000..6018eff4c
--- /dev/null
+++ b/patches/mmc-utils-2018-03-27-gb4fe0c8c0e57/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-lsmmc-replace-strncpy-with-memmove-on-overlapping-me.patch
+# eb541e33133cca3f061e8631e6c490ca - git-ptx-patches magic