Patch "USB: serial: console: move mutex_unlock() before usb_serial_put()" has been added to the 4.19-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: serial: console: move mutex_unlock() before usb_serial_put()

to the 4.19-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-serial-console-move-mutex_unlock-before-usb_seri.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 8018340be2eb73f413e44383b523eca8b1ce1d5d
Author: Liang He <windhl@xxxxxxx>
Date:   Mon Sep 19 18:48:24 2022 +0800

    USB: serial: console: move mutex_unlock() before usb_serial_put()
    
    [ Upstream commit 61dfa797c731754642d1ac500a6ac42f9b47f920 ]
    
    While in current version there is no use-after-free as USB serial
    core holds another reference when the console is registered, we
    should better unlock before dropping the reference in
    usb_console_setup().
    
    Fixes: 7bd032dc2793 ("USB serial: update the console driver")
    Signed-off-by: Liang He <windhl@xxxxxxx>
    Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 7d289302ff6c..299bdb3a58fe 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -186,8 +186,8 @@ static int usb_console_setup(struct console *co, char *options)
 	info->port = NULL;
 	usb_autopm_put_interface(serial->interface);
  error_get_interface:
-	usb_serial_put(serial);
 	mutex_unlock(&serial->disc_mutex);
+	usb_serial_put(serial);
 	return retval;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux