]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
one more .23 patch
authorGreg Kroah-Hartman <gregkh@suse.de>
Wed, 14 Nov 2007 22:32:16 +0000 (14:32 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 14 Nov 2007 22:32:16 +0000 (14:32 -0800)
queue-2.6.23/series
queue-2.6.23/usb-usbserial-fix-potential-deadlock-between-write-and-irq.patch [new file with mode: 0644]

index 958b66f59e0ec5172752ea755a9522d184bdd461..844bf80e51646d3827a11916e8ba573ed241d849 100644 (file)
@@ -110,3 +110,4 @@ zd1201-avoid-null-ptr-access-of-skb-dev.patch
 ipw2100-send-wext-scan-events.patch
 rtl8187-fix-more-frag-bit-checking-rts-duration-calc.patch
 zd1211rw-fix-oops-when-ejecting-install-media.patch
+usb-usbserial-fix-potential-deadlock-between-write-and-irq.patch
diff --git a/queue-2.6.23/usb-usbserial-fix-potential-deadlock-between-write-and-irq.patch b/queue-2.6.23/usb-usbserial-fix-potential-deadlock-between-write-and-irq.patch
new file mode 100644 (file)
index 0000000..9c82a76
--- /dev/null
@@ -0,0 +1,46 @@
+From acd2a847e7fee7df11817f67dba75a2802793e5d Mon Sep 17 00:00:00 2001
+From: Jiri Kosina <jkosina@suse.cz>
+Date: Sat, 20 Oct 2007 00:05:19 +0200
+Subject: USB: usbserial - fix potential deadlock between write() and IRQ
+Message-ID: <20071102152622.GB7279@kroah.com>
+
+From: Jiri Kosina <jkosina@suse.cz>
+
+patch acd2a847e7fee7df11817f67dba75a2802793e5d in mainline.
+
+USB: usbserial - fix potential deadlock between write() and IRQ
+
+usb_serial_generic_write() doesn't disable interrupts when taking port->lock,
+and could therefore deadlock with usb_serial_generic_read_bulk_callback()
+being called from interrupt, taking the same lock. Fix it.
+
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Acked-by: Larry Finger <larry.finger@lwfinger.net>
+Cc: Marcin Slusarz <marcin.slusarz@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/generic.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/serial/generic.c
++++ b/drivers/usb/serial/generic.c
+@@ -208,14 +208,15 @@ int usb_serial_generic_write(struct usb_
+       /* only do something if we have a bulk out endpoint */
+       if (serial->num_bulk_out) {
+-              spin_lock_bh(&port->lock);
++              unsigned long flags;
++              spin_lock_irqsave(&port->lock, flags);
+               if (port->write_urb_busy) {
+-                      spin_unlock_bh(&port->lock);
++                      spin_unlock_irqrestore(&port->lock, flags);
+                       dbg("%s - already writing", __FUNCTION__);
+                       return 0;
+               }
+               port->write_urb_busy = 1;
+-              spin_unlock_bh(&port->lock);
++              spin_unlock_irqrestore(&port->lock, flags);
+               count = (count > port->bulk_out_size) ? port->bulk_out_size : count;