From 430183f8c09d725c1599ea34c4bd6304f93d55ba Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 5 Apr 2021 10:05:08 +0200 Subject: [PATCH] 4.4-stable patches added patches: cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch usb-cdc-acm-downgrade-message-to-debug.patch usb-cdc-acm-fix-use-after-free-after-probe-failure.patch usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch --- ...-rx-code-path-adding-necessary-calls.patch | 35 ++++++++++++++++ queue-4.4/series | 4 ++ ...b-cdc-acm-downgrade-message-to-debug.patch | 33 +++++++++++++++ ...x-use-after-free-after-probe-failure.patch | 39 +++++++++++++++++ ...wake-up-on-fibocom-l850-gl-lte-modem.patch | 42 +++++++++++++++++++ 5 files changed, 153 insertions(+) create mode 100644 queue-4.4/cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch create mode 100644 queue-4.4/usb-cdc-acm-downgrade-message-to-debug.patch create mode 100644 queue-4.4/usb-cdc-acm-fix-use-after-free-after-probe-failure.patch create mode 100644 queue-4.4/usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch diff --git a/queue-4.4/cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch b/queue-4.4/cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch new file mode 100644 index 00000000000..522fcee8f66 --- /dev/null +++ b/queue-4.4/cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch @@ -0,0 +1,35 @@ +From 08dff274edda54310d6f1cf27b62fddf0f8d146e Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 11 Mar 2021 14:37:14 +0100 +Subject: cdc-acm: fix BREAK rx code path adding necessary calls + +From: Oliver Neukum + +commit 08dff274edda54310d6f1cf27b62fddf0f8d146e upstream. + +Counting break events is nice but we should actually report them to +the tty layer. + +Fixes: 5a6a62bdb9257 ("cdc-acm: add TIOCMIWAIT") +Signed-off-by: Oliver Neukum +Link: https://lore.kernel.org/r/20210311133714.31881-1-oneukum@suse.com +Cc: stable +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/class/cdc-acm.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -334,8 +334,10 @@ static void acm_ctrl_irq(struct urb *urb + acm->iocount.dsr++; + if (difference & ACM_CTRL_DCD) + acm->iocount.dcd++; +- if (newctrl & ACM_CTRL_BRK) ++ if (newctrl & ACM_CTRL_BRK) { + acm->iocount.brk++; ++ tty_insert_flip_char(&acm->port, 0, TTY_BREAK); ++ } + if (newctrl & ACM_CTRL_RI) + acm->iocount.rng++; + if (newctrl & ACM_CTRL_FRAMING) diff --git a/queue-4.4/series b/queue-4.4/series index 290f5ab14a8..91d4bb4282a 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -20,3 +20,7 @@ reiserfs-update-reiserfs_xattrs_initialized-condition.patch pinctrl-rockchip-fix-restore-error-in-resume.patch extcon-fix-error-handling-in-extcon_dev_register.patch firewire-nosy-fix-a-use-after-free-bug-in-nosy_ioctl.patch +usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch +cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch +usb-cdc-acm-downgrade-message-to-debug.patch +usb-cdc-acm-fix-use-after-free-after-probe-failure.patch diff --git a/queue-4.4/usb-cdc-acm-downgrade-message-to-debug.patch b/queue-4.4/usb-cdc-acm-downgrade-message-to-debug.patch new file mode 100644 index 00000000000..0b399757b25 --- /dev/null +++ b/queue-4.4/usb-cdc-acm-downgrade-message-to-debug.patch @@ -0,0 +1,33 @@ +From e4c77070ad45fc940af1d7fb1e637c349e848951 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 11 Mar 2021 14:01:26 +0100 +Subject: USB: cdc-acm: downgrade message to debug + +From: Oliver Neukum + +commit e4c77070ad45fc940af1d7fb1e637c349e848951 upstream. + +This failure is so common that logging an error here amounts +to spamming log files. + +Reviewed-by: Bruno Thomsen +Signed-off-by: Oliver Neukum +Cc: stable +Link: https://lore.kernel.org/r/20210311130126.15972-2-oneukum@suse.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/class/cdc-acm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -550,7 +550,8 @@ static void acm_port_dtr_rts(struct tty_ + + res = acm_set_control(acm, val); + if (res && (acm->ctrl_caps & USB_CDC_CAP_LINE)) +- dev_err(&acm->control->dev, "failed to set dtr/rts\n"); ++ /* This is broken in too many devices to spam the logs */ ++ dev_dbg(&acm->control->dev, "failed to set dtr/rts\n"); + } + + static int acm_port_activate(struct tty_port *port, struct tty_struct *tty) diff --git a/queue-4.4/usb-cdc-acm-fix-use-after-free-after-probe-failure.patch b/queue-4.4/usb-cdc-acm-fix-use-after-free-after-probe-failure.patch new file mode 100644 index 00000000000..134964ed3b9 --- /dev/null +++ b/queue-4.4/usb-cdc-acm-fix-use-after-free-after-probe-failure.patch @@ -0,0 +1,39 @@ +From 4e49bf376c0451ad2eae2592e093659cde12be9a Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 22 Mar 2021 16:53:12 +0100 +Subject: USB: cdc-acm: fix use-after-free after probe failure + +From: Johan Hovold + +commit 4e49bf376c0451ad2eae2592e093659cde12be9a upstream. + +If tty-device registration fails the driver would fail to release the +data interface. When the device is later disconnected, the disconnect +callback would still be called for the data interface and would go about +releasing already freed resources. + +Fixes: c93d81955005 ("usb: cdc-acm: fix error handling in acm_probe()") +Cc: stable@vger.kernel.org # 3.9 +Cc: Alexey Khoroshilov +Acked-by: Oliver Neukum +Signed-off-by: Johan Hovold +Link: https://lore.kernel.org/r/20210322155318.9837-3-johan@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/class/cdc-acm.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -1502,6 +1502,11 @@ skip_countries: + + return 0; + alloc_fail8: ++ if (!acm->combined_interfaces) { ++ /* Clear driver data so that disconnect() returns early. */ ++ usb_set_intfdata(data_interface, NULL); ++ usb_driver_release_interface(&acm_driver, data_interface); ++ } + if (acm->country_codes) { + device_remove_file(&acm->control->dev, + &dev_attr_wCountryCodes); diff --git a/queue-4.4/usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch b/queue-4.4/usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch new file mode 100644 index 00000000000..e124fb15604 --- /dev/null +++ b/queue-4.4/usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch @@ -0,0 +1,42 @@ +From 0bd860493f81eb2a46173f6f5e44cc38331c8dbd Mon Sep 17 00:00:00 2001 +From: Vincent Palatin +Date: Fri, 19 Mar 2021 13:48:02 +0100 +Subject: USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem + +From: Vincent Palatin + +commit 0bd860493f81eb2a46173f6f5e44cc38331c8dbd upstream. + +This LTE modem (M.2 card) has a bug in its power management: +there is some kind of race condition for U3 wake-up between the host and +the device. The modem firmware sometimes crashes/locks when both events +happen at the same time and the modem fully drops off the USB bus (and +sometimes re-enumerates, sometimes just gets stuck until the next +reboot). + +Tested with the modem wired to the XHCI controller on an AMD 3015Ce +platform. Without the patch, the modem dropped of the USB bus 5 times in +3 days. With the quirk, it stayed connected for a week while the +'runtime_suspended_time' counter incremented as excepted. + +Signed-off-by: Vincent Palatin +Link: https://lore.kernel.org/r/20210319124802.2315195-1-vpalatin@chromium.org +Cc: stable +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/core/quirks.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -321,6 +321,10 @@ static const struct usb_device_id usb_qu + /* DJI CineSSD */ + { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM }, + ++ /* Fibocom L850-GL LTE Modem */ ++ { USB_DEVICE(0x2cb7, 0x0007), .driver_info = ++ USB_QUIRK_IGNORE_REMOTE_WAKEUP }, ++ + /* INTEL VALUE SSD */ + { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME }, + -- 2.47.3