]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 29 Apr 2018 11:49:23 +0000 (13:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 29 Apr 2018 11:49:23 +0000 (13:49 +0200)
added patches:
kobject-don-t-use-warn-for-registration-failures.patch
scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch

queue-3.18/kobject-don-t-use-warn-for-registration-failures.patch [new file with mode: 0644]
queue-3.18/scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch [new file with mode: 0644]
queue-3.18/series

diff --git a/queue-3.18/kobject-don-t-use-warn-for-registration-failures.patch b/queue-3.18/kobject-don-t-use-warn-for-registration-failures.patch
new file mode 100644 (file)
index 0000000..7b430e3
--- /dev/null
@@ -0,0 +1,47 @@
+From 3e14c6abbfb5c94506edda9d8e2c145d79375798 Mon Sep 17 00:00:00 2001
+From: Dmitry Vyukov <dvyukov@google.com>
+Date: Wed, 11 Apr 2018 17:22:43 +0200
+Subject: kobject: don't use WARN for registration failures
+
+From: Dmitry Vyukov <dvyukov@google.com>
+
+commit 3e14c6abbfb5c94506edda9d8e2c145d79375798 upstream.
+
+This WARNING proved to be noisy. The function still returns an error
+and callers should handle it. That's how most of kernel code works.
+Downgrade the WARNING to pr_err() and leave WARNINGs for kernel bugs.
+
+Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
+Reported-by: syzbot+209c0f67f99fec8eb14b@syzkaller.appspotmail.com
+Reported-by: syzbot+7fb6d9525a4528104e05@syzkaller.appspotmail.com
+Reported-by: syzbot+2e63711063e2d8f9ea27@syzkaller.appspotmail.com
+Reported-by: syzbot+de73361ee4971b6e6f75@syzkaller.appspotmail.com
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ lib/kobject.c |   12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+--- a/lib/kobject.c
++++ b/lib/kobject.c
+@@ -234,14 +234,12 @@ static int kobject_add_internal(struct k
+               /* be noisy on error issues */
+               if (error == -EEXIST)
+-                      WARN(1, "%s failed for %s with "
+-                           "-EEXIST, don't try to register things with "
+-                           "the same name in the same directory.\n",
+-                           __func__, kobject_name(kobj));
++                      pr_err("%s failed for %s with -EEXIST, don't try to register things with the same name in the same directory.\n",
++                             __func__, kobject_name(kobj));
+               else
+-                      WARN(1, "%s failed for %s (error: %d parent: %s)\n",
+-                           __func__, kobject_name(kobj), error,
+-                           parent ? kobject_name(parent) : "'none'");
++                      pr_err("%s failed for %s (error: %d parent: %s)\n",
++                             __func__, kobject_name(kobj), error,
++                             parent ? kobject_name(parent) : "'none'");
+       } else
+               kobj->state_in_sysfs = 1;
diff --git a/queue-3.18/scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch b/queue-3.18/scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch
new file mode 100644 (file)
index 0000000..7aa7ddb
--- /dev/null
@@ -0,0 +1,36 @@
+From 505aa4b6a8834a2300971c5220c380c3271ebde3 Mon Sep 17 00:00:00 2001
+From: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>
+Date: Tue, 17 Apr 2018 17:03:12 +0530
+Subject: scsi: sd: Defer spinning up drive while SANITIZE is in progress
+
+From: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>
+
+commit 505aa4b6a8834a2300971c5220c380c3271ebde3 upstream.
+
+A drive being sanitized will return NOT READY / ASC 0x4 / ASCQ
+0x1b ("LOGICAL UNIT NOT READY. SANITIZE IN PROGRESS").
+
+Prevent spinning up the drive until this condition clears.
+
+[mkp: tweaked commit message]
+
+Signed-off-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/sd.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/scsi/sd.c
++++ b/drivers/scsi/sd.c
+@@ -1848,6 +1848,8 @@ sd_spinup_disk(struct scsi_disk *sdkp)
+                               break;  /* standby */
+                       if (sshdr.asc == 4 && sshdr.ascq == 0xc)
+                               break;  /* unavailable */
++                      if (sshdr.asc == 4 && sshdr.ascq == 0x1b)
++                              break;  /* sanitize in progress */
+                       /*
+                        * Issue command to spin up drive when not ready
+                        */
index 58491b829084c4b0f150f33662b85156360ae6e1..e3de4c65c8272ab4e5462ed8c3e9fe363d2afa39 100644 (file)
@@ -18,3 +18,5 @@ alsa-seq-oss-fix-unbalanced-use-lock-for-synth-midi-device.patch
 mtd-cfi-cmdset_0001-do-not-allow-read-write-to-suspend-erase-block.patch
 mtd-cfi-cmdset_0001-workaround-micron-erase-suspend-bug.patch
 mtd-cfi-cmdset_0002-do-not-allow-read-write-to-suspend-erase-block.patch
+kobject-don-t-use-warn-for-registration-failures.patch
+scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch