From: Greg Kroah-Hartman Date: Thu, 6 Dec 2018 05:54:30 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.19.8~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ebe617aaf42d587c4b27cfaa95822b934576ad9;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: test_hexdump-use-memcpy-instead-of-strncpy.patch --- diff --git a/queue-4.19/series b/queue-4.19/series index 9fa52e38e9f..0738ea788d7 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -1 +1,2 @@ blk-mq-fix-corruption-with-direct-issue.patch +test_hexdump-use-memcpy-instead-of-strncpy.patch diff --git a/queue-4.19/test_hexdump-use-memcpy-instead-of-strncpy.patch b/queue-4.19/test_hexdump-use-memcpy-instead-of-strncpy.patch new file mode 100644 index 00000000000..06bcb2ad2e5 --- /dev/null +++ b/queue-4.19/test_hexdump-use-memcpy-instead-of-strncpy.patch @@ -0,0 +1,38 @@ +From b1286ed7158e9b62787508066283ab0b8850b518 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Fri, 30 Nov 2018 12:13:15 -0800 +Subject: test_hexdump: use memcpy instead of strncpy + +From: Linus Torvalds + +commit b1286ed7158e9b62787508066283ab0b8850b518 upstream. + +New versions of gcc reasonably warn about the odd pattern of + + strncpy(p, q, strlen(q)); + +which really doesn't make sense: the strncpy() ends up being just a slow +and odd way to write memcpy() in this case. + +Apparently there was a patch for this floating around earlier, but it +got lost. + +Acked-again-by: Andy Shevchenko +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + lib/test_hexdump.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/test_hexdump.c ++++ b/lib/test_hexdump.c +@@ -99,7 +99,7 @@ static void __init test_hexdump_prepare_ + const char *q = *result++; + size_t amount = strlen(q); + +- strncpy(p, q, amount); ++ memcpy(p, q, amount); + p += amount; + + *p++ = ' ';