Patch "USB: sierra: fix AA deadlock in open error path" has been added to the 3.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    USB: sierra: fix AA deadlock in open error path

to the 3.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-sierra-fix-aa-deadlock-in-open-error-path.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 353fe198602e8b4d1c7bdcceb8e60955087201b1 Mon Sep 17 00:00:00 2001
From: Johan Hovold <jhovold@xxxxxxxxx>
Date: Mon, 26 May 2014 19:22:50 +0200
Subject: USB: sierra: fix AA deadlock in open error path

From: Johan Hovold <jhovold@xxxxxxxxx>

commit 353fe198602e8b4d1c7bdcceb8e60955087201b1 upstream.

Fix AA deadlock in open error path that would call close() and try to
grab the already held disc_mutex.

Fixes: b9a44bc19f48 ("sierra: driver urb handling improvements")

Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/usb/serial/sierra.c |   21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -816,14 +816,9 @@ static int sierra_open(struct tty_struct
 			usb_sndbulkpipe(serial->dev, endpoint) | USB_DIR_IN);
 
 	err = sierra_submit_rx_urbs(port, GFP_KERNEL);
-	if (err) {
-		/* get rid of everything as in close */
-		sierra_close(port);
-		/* restore balance for autopm */
-		if (!serial->disconnected)
-			usb_autopm_put_interface(serial->interface);
-		return err;
-	}
+	if (err)
+		goto err_submit;
+
 	sierra_send_setup(port);
 
 	serial->interface->needs_remote_wakeup = 1;
@@ -833,6 +828,16 @@ static int sierra_open(struct tty_struct
 	usb_autopm_put_interface(serial->interface);
 
 	return 0;
+
+err_submit:
+	sierra_stop_rx_urbs(port);
+
+	for (i = 0; i < portdata->num_in_urbs; i++) {
+		sierra_release_urb(portdata->in_urbs[i]);
+		portdata->in_urbs[i] = NULL;
+	}
+
+	return err;
 }
 
 


Patches currently in stable-queue which might be from jhovold@xxxxxxxxx are

queue-3.14/usb-sierra-fix-urb-and-memory-leak-in-resume-error-path.patch
queue-3.14/usb-sierra-fix-aa-deadlock-in-open-error-path.patch
queue-3.14/usb-usb_wwan-fix-urb-leak-at-shutdown.patch
queue-3.14/usb-option-fix-runtime-pm-handling.patch
queue-3.14/usb-sierra-fix-remote-wakeup.patch
queue-3.14/usb-sierra-fix-urb-and-memory-leak-on-disconnect.patch
queue-3.14/net-cpsw-fix-null-dereference-at-probe.patch
queue-3.14/usb-sierra-fix-use-after-free-at-suspend-resume.patch
queue-3.14/usb-usb_wwan-fix-write-and-suspend-race.patch
queue-3.14/revert-net-eth-cpsw-correctly-attach-to-gpio-bitbang-mdio.patch
queue-3.14/usb-usb_wwan-fix-potential-null-deref-at-resume.patch
queue-3.14/usb-usb_wwan-fix-race-between-write-and-resume.patch
queue-3.14/usb-usb_wwan-fix-potential-blocked-i-o-after-resume.patch
queue-3.14/usb-usb_wwan-fix-urb-leak-in-write-error-path.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]