]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Oct 2024 11:29:01 +0000 (13:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Oct 2024 11:29:01 +0000 (13:29 +0200)
added patches:
usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch

queue-5.10/series
queue-5.10/usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch [new file with mode: 0644]

index 784dfc2135ea2b17706f1e3f342ab6abf76a419d..41f5a9d1259a7c7b93a5d94e26285f8c432f8829 100644 (file)
@@ -272,3 +272,4 @@ lockdep-fix-deadlock-issue-between-lockdep-and-rcu.patch
 mm-only-enforce-minimum-stack-gap-size-if-it-s-sensible.patch
 i2c-aspeed-update-the-stop-sw-state-when-the-bus-recovery-occurs.patch
 i2c-isch-add-missed-else.patch
+usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch
diff --git a/queue-5.10/usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch b/queue-5.10/usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch
new file mode 100644 (file)
index 0000000..1b51140
--- /dev/null
@@ -0,0 +1,36 @@
+From e7d3b9f28654dbfce7e09f8028210489adaf6a33 Mon Sep 17 00:00:00 2001
+From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
+Date: Mon, 18 Dec 2023 22:36:35 -0800
+Subject: usb: yurex: Fix inconsistent locking bug in yurex_read()
+
+From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
+
+commit e7d3b9f28654dbfce7e09f8028210489adaf6a33 upstream.
+
+Unlock before returning on the error path.
+
+Fixes: 86b20af11e84 ("usb: yurex: Replace snprintf() with the safer scnprintf() variant")
+Reported-by: Dan Carpenter <error27@gmail.com>
+Reported-by: kernel test robot <lkp@intel.com>
+Closes: https://lore.kernel.org/r/202312170252.3udgrIcP-lkp@intel.com/
+Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
+Link: https://lore.kernel.org/r/20231219063639.450994-1-harshit.m.mogalapalli@oracle.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/misc/yurex.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/misc/yurex.c
++++ b/drivers/usb/misc/yurex.c
+@@ -412,8 +412,10 @@ static ssize_t yurex_read(struct file *f
+               return -ENODEV;
+       }
+-      if (WARN_ON_ONCE(dev->bbu > S64_MAX || dev->bbu < S64_MIN))
++      if (WARN_ON_ONCE(dev->bbu > S64_MAX || dev->bbu < S64_MIN)) {
++              mutex_unlock(&dev->io_mutex);
+               return -EIO;
++      }
+       spin_lock_irq(&dev->lock);
+       scnprintf(in_buffer, MAX_S64_STRLEN, "%lld\n", dev->bbu);