Commit 66389c59 authored by Johan Hovold's avatar Johan Hovold Committed by Khalid Elmously

USB: serial: suppress driver bind attributes

BugLink: https://bugs.launchpad.net/bugs/1860681

commit fdb838ef upstream.

USB-serial drivers must not be unbound from their ports before the
corresponding USB driver is unbound from the parent interface so
suppress the bind and unbind attributes.

Unbinding a serial driver while it's port is open is a sure way to
trigger a crash as any driver state is released on unbind while port
hangup is handled on the parent USB interface level. Drivers for
multiport devices where ports share a resource such as an interrupt
endpoint also generally cannot handle individual ports going away.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 4db95a70
...@@ -1350,6 +1350,9 @@ static int usb_serial_register(struct usb_serial_driver *driver) ...@@ -1350,6 +1350,9 @@ static int usb_serial_register(struct usb_serial_driver *driver)
return -EINVAL; return -EINVAL;
} }
/* Prevent individual ports from being unbound. */
driver->driver.suppress_bind_attrs = true;
usb_serial_operations_init(driver); usb_serial_operations_init(driver);
/* Add this device to our list of devices */ /* Add this device to our list of devices */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment