]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Dec 2018 13:10:33 +0000 (14:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Dec 2018 13:10:33 +0000 (14:10 +0100)
added patches:
staging-lustre-remove-two-build-warnings.patch

queue-3.18/series
queue-3.18/staging-lustre-remove-two-build-warnings.patch [new file with mode: 0644]

index 534f0b672d1db8b7e376b68e861e72295f9d7c0b..9cf6079c21df00cb7d9e957079485de7c767b2cf 100644 (file)
@@ -48,3 +48,4 @@ sunrpc-fix-leak-of-krb5p-encode-pages.patch
 dmaengine-cppi41-delete-channel-from-pending-list-when-stop-channel.patch
 xhci-prevent-u1-u2-link-pm-states-if-exit-latency-is-too-long.patch
 usb-serial-option-add-device-id-for-hp-lt2523-novate.patch
+staging-lustre-remove-two-build-warnings.patch
diff --git a/queue-3.18/staging-lustre-remove-two-build-warnings.patch b/queue-3.18/staging-lustre-remove-two-build-warnings.patch
new file mode 100644 (file)
index 0000000..dedc78b
--- /dev/null
@@ -0,0 +1,46 @@
+From gregkh@linuxfoundation.org  Tue Dec 11 14:07:57 2018
+From: Greg KH <gregkh@linuxfoundation.org>
+Date: Tue, 11 Dec 2018 13:50:37 +0100
+Subject: Staging: lustre: remove two build warnings
+To: linux-kernel@vger.kernel.org
+Cc: stable@vger.kernel.org
+Message-ID: <20181211125037.GA25594@kroah.com>
+Content-Disposition: inline
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+[for older kernels only, lustre has been removed from upstream]
+
+When someone writes:
+       strncpy(dest, source, sizeof(source));
+they really are just doing the same thing as:
+       strcpy(dest, source);
+but somehow they feel better because they are now using the "safe"
+version of the string functions.  Cargo-cult programming at its
+finest...
+
+gcc-8 rightfully warns you about doing foolish things like this.  Now
+that the stable kernels are all starting to be built using gcc-8, let's
+get rid of this warning so that we do not have to gaze at this horror.
+
+To dropt the warning, just convert the code to using strcpy() so that if
+someone really wants to audit this code and find all of the obvious
+problems, it will be easier to do so.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/lustre/lustre/lmv/lmv_obd.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
++++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+@@ -736,7 +736,7 @@ repeat_fid2path:
+               memmove(ptr + strlen(gf->gf_path) + 1, ptr,
+                       strlen(ori_gf->gf_path));
+-              strncpy(ptr, gf->gf_path, strlen(gf->gf_path));
++              strcpy(ptr, gf->gf_path);
+               ptr += strlen(gf->gf_path);
+               *ptr = '/';
+       }