]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Mar 2021 12:36:17 +0000 (13:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Mar 2021 12:36:17 +0000 (13:36 +0100)
added patches:
scsi-lpfc-fix-some-error-codes-in-debugfs.patch

queue-4.4/scsi-lpfc-fix-some-error-codes-in-debugfs.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/scsi-lpfc-fix-some-error-codes-in-debugfs.patch b/queue-4.4/scsi-lpfc-fix-some-error-codes-in-debugfs.patch
new file mode 100644 (file)
index 0000000..e41f89b
--- /dev/null
@@ -0,0 +1,41 @@
+From 19f1bc7edf0f97186810e13a88f5b62069d89097 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Fri, 12 Mar 2021 10:42:11 +0300
+Subject: scsi: lpfc: Fix some error codes in debugfs
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit 19f1bc7edf0f97186810e13a88f5b62069d89097 upstream.
+
+If copy_from_user() or kstrtoull() fail then the correct behavior is to
+return a negative error code.
+
+Link: https://lore.kernel.org/r/YEsbU/UxYypVrC7/@mwanda
+Fixes: f9bb2da11db8 ("[SCSI] lpfc 8.3.27: T10 additions for SLI4")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/lpfc/lpfc_debugfs.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/scsi/lpfc/lpfc_debugfs.c
++++ b/drivers/scsi/lpfc/lpfc_debugfs.c
+@@ -1061,7 +1061,7 @@ lpfc_debugfs_dif_err_write(struct file *
+       memset(dstbuf, 0, 32);
+       size = (nbytes < 32) ? nbytes : 32;
+       if (copy_from_user(dstbuf, buf, size))
+-              return 0;
++              return -EFAULT;
+       if (dent == phba->debug_InjErrLBA) {
+               if ((buf[0] == 'o') && (buf[1] == 'f') && (buf[2] == 'f'))
+@@ -1069,7 +1069,7 @@ lpfc_debugfs_dif_err_write(struct file *
+       }
+       if ((tmp == 0) && (kstrtoull(dstbuf, 0, &tmp)))
+-              return 0;
++              return -EINVAL;
+       if (dent == phba->debug_writeGuard)
+               phba->lpfc_injerr_wgrd_cnt = (uint32_t)tmp;
index fc83a625bb1b3e66aaae75903c25ade54479f36a..7a8825cd0ec29bf2aa573f7c5676d73da87382dc 100644 (file)
@@ -4,3 +4,4 @@ ext4-check-journal-inode-extents-more-carefully.patch
 platform-chrome-cros_ec_dev-fix-security-issue.patch
 btrfs-fix-race-when-cloning-extent-buffer-during-rewind-of-an-old-root.patch
 nfsd-repair-misuse-of-sv_lock-in-5.10.16-rt30.patch
+scsi-lpfc-fix-some-error-codes-in-debugfs.patch