From: Greg Kroah-Hartman Date: Wed, 2 Oct 2024 11:28:16 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v6.6.54~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97a797545edac4f68fa5502f08ffadec9f57ebf5;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch --- diff --git a/queue-4.19/series b/queue-4.19/series index a09c5820658..511bd1edbc4 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -133,3 +133,4 @@ pps-remove-usage-of-the-deprecated-ida_simple_xx-api.patch pps-add-an-error-check-in-parport_attach.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-4.19/usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch b/queue-4.19/usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch new file mode 100644 index 00000000000..9850d771eb7 --- /dev/null +++ b/queue-4.19/usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch @@ -0,0 +1,36 @@ +From e7d3b9f28654dbfce7e09f8028210489adaf6a33 Mon Sep 17 00:00:00 2001 +From: Harshit Mogalapalli +Date: Mon, 18 Dec 2023 22:36:35 -0800 +Subject: usb: yurex: Fix inconsistent locking bug in yurex_read() + +From: Harshit Mogalapalli + +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 +Reported-by: kernel test robot +Closes: https://lore.kernel.org/r/202312170252.3udgrIcP-lkp@intel.com/ +Signed-off-by: Harshit Mogalapalli +Link: https://lore.kernel.org/r/20231219063639.450994-1-harshit.m.mogalapalli@oracle.com +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -414,8 +414,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);