From: Greg Kroah-Hartman Date: Fri, 2 Feb 2018 10:37:33 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.4.115~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=80f621dcf2bd8f568331352662ddeeb9969f7e31;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: cdc-acm-apply-quirk-for-card-reader.patch selinux-general-protection-fault-in-sock_has_perm.patch serial-imx-only-wakeup-via-rtsden-bit-if-the-system-has-rts-cts.patch spi-imx-do-not-access-registers-while-clocks-disabled.patch usb-cdc-acm-do-not-log-urb-submission-errors-on-disconnect.patch usb-f_fs-prevent-gadget-unbind-if-it-is-already-unbound.patch usb-option-add-support-for-fs040u-modem.patch usb-serial-io_edgeport-fix-possible-sleep-in-atomic.patch usb-serial-pl2303-new-device-id-for-chilitag.patch usb-serial-simple-add-motorola-tetra-driver.patch usb-uas-unconditionally-bring-back-host-after-reset.patch usbip-list-don-t-list-devices-attached-to-vhci_hcd.patch usbip-prevent-bind-loops-on-devices-attached-to-vhci_hcd.patch --- diff --git a/queue-4.4/cdc-acm-apply-quirk-for-card-reader.patch b/queue-4.4/cdc-acm-apply-quirk-for-card-reader.patch new file mode 100644 index 00000000000..f7c60f3ce90 --- /dev/null +++ b/queue-4.4/cdc-acm-apply-quirk-for-card-reader.patch @@ -0,0 +1,31 @@ +From df1cc78a52491f71d8170d513d0f6f114faa1bda Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 18 Jan 2018 12:13:45 +0100 +Subject: CDC-ACM: apply quirk for card reader + +From: Oliver Neukum + +commit df1cc78a52491f71d8170d513d0f6f114faa1bda upstream. + +This devices drops random bytes from messages if you talk to it +too fast. + +Signed-off-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-acm.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -1695,6 +1695,9 @@ static const struct usb_device_id acm_id + { USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */ + .driver_info = SINGLE_RX_URB, /* firmware bug */ + }, ++ { USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */ ++ .driver_info = SINGLE_RX_URB, ++ }, + { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ + .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ + }, diff --git a/queue-4.4/selinux-general-protection-fault-in-sock_has_perm.patch b/queue-4.4/selinux-general-protection-fault-in-sock_has_perm.patch new file mode 100644 index 00000000000..a30f2b44f27 --- /dev/null +++ b/queue-4.4/selinux-general-protection-fault-in-sock_has_perm.patch @@ -0,0 +1,84 @@ +From salyzyn@android.com Fri Feb 2 11:25:36 2018 +From: Mark Salyzyn +Date: Thu, 1 Feb 2018 07:37:04 -0800 +Subject: selinux: general protection fault in sock_has_perm +To: linux-kernel@vger.kernel.org +Cc: Mark Salyzyn , Paul Moore , Greg KH , Eric Dumazet , Stephen Smalley , selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org, Eric Paris , "Serge E . Hallyn" , stable , Paul Moore , James Morris +Message-ID: <20180201153708.63506-1-salyzyn@android.com> + +From: Mark Salyzyn + +In the absence of commit a4298e4522d6 ("net: add SOCK_RCU_FREE socket +flag") and all the associated infrastructure changes to take advantage +of a RCU grace period before freeing, there is a heightened +possibility that a security check is performed while an ill-timed +setsockopt call races in from user space. It then is prudent to null +check sk_security, and if the case, reject the permissions. + +Because of the nature of this problem, hard to duplicate, no clear +path, this patch is a simplified band-aid for stable trees lacking the +infrastructure for the series of commits leading up to providing a +suitable RCU grace period. This adjustment is orthogonal to +infrastructure improvements that may nullify the needed check, but +could be added as good code hygiene in all trees. + +general protection fault: 0000 [#1] PREEMPT SMP KASAN +CPU: 1 PID: 14233 Comm: syz-executor2 Not tainted 4.4.112-g5f6325b #28 +task: ffff8801d1095f00 task.stack: ffff8800b5950000 +RIP: 0010:[] [] sock_has_perm+0x1fe/0x3e0 security/selinux/hooks.c:4069 +RSP: 0018:ffff8800b5957ce0 EFLAGS: 00010202 +RAX: dffffc0000000000 RBX: 1ffff10016b2af9f RCX: ffffffff81b69b51 +RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000010 +RBP: ffff8800b5957de0 R08: 0000000000000001 R09: 0000000000000001 +R10: 0000000000000000 R11: 1ffff10016b2af68 R12: ffff8800b5957db8 +R13: 0000000000000000 R14: ffff8800b7259f40 R15: 00000000000000d7 +FS: 00007f72f5ae2700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 0000000000a2fa38 CR3: 00000001d7980000 CR4: 0000000000160670 +DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +Stack: + ffffffff81b69a1f ffff8800b5957d58 00008000b5957d30 0000000041b58ab3 + ffffffff83fc82f2 ffffffff81b69980 0000000000000246 ffff8801d1096770 + ffff8801d3165668 ffffffff8157844b ffff8801d1095f00 + ffff880000000001 +Call Trace: +[] selinux_socket_setsockopt+0x4d/0x80 security/selinux/hooks.c:4338 +[] security_socket_setsockopt+0x7d/0xb0 security/security.c:1257 +[] SYSC_setsockopt net/socket.c:1757 [inline] +[] SyS_setsockopt+0xe8/0x250 net/socket.c:1746 +[] entry_SYSCALL_64_fastpath+0x16/0x92 +Code: c2 42 9b b6 81 be 01 00 00 00 48 c7 c7 a0 cb 2b 84 e8 +f7 2f 6d ff 49 8d 7d 10 48 b8 00 00 00 00 00 fc ff df 48 89 +fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 83 01 00 +00 41 8b 75 10 31 +RIP [] sock_has_perm+0x1fe/0x3e0 security/selinux/hooks.c:4069 +RSP +---[ end trace 7b5aaf788fef6174 ]--- + +Signed-off-by: Mark Salyzyn +Acked-by: Paul Moore +Cc: Eric Dumazet +Cc: Stephen Smalley +Cc: selinux@tycho.nsa.gov +Cc: linux-security-module@vger.kernel.org +Cc: Eric Paris +Cc: Serge E. Hallyn +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + security/selinux/hooks.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/security/selinux/hooks.c ++++ b/security/selinux/hooks.c +@@ -4032,6 +4032,8 @@ static int sock_has_perm(struct task_str + struct lsm_network_audit net = {0,}; + u32 tsid = task_sid(task); + ++ if (!sksec) ++ return -EFAULT; + if (sksec->sid == SECINITSID_KERNEL) + return 0; + diff --git a/queue-4.4/serial-imx-only-wakeup-via-rtsden-bit-if-the-system-has-rts-cts.patch b/queue-4.4/serial-imx-only-wakeup-via-rtsden-bit-if-the-system-has-rts-cts.patch new file mode 100644 index 00000000000..bfc9741eb0d --- /dev/null +++ b/queue-4.4/serial-imx-only-wakeup-via-rtsden-bit-if-the-system-has-rts-cts.patch @@ -0,0 +1,46 @@ +From 38b1f0fb42f772b8c9aac53593883a18ff5eb9d7 Mon Sep 17 00:00:00 2001 +From: Fabio Estevam +Date: Thu, 4 Jan 2018 15:58:34 -0200 +Subject: serial: imx: Only wakeup via RTSDEN bit if the system has RTS/CTS + +From: Fabio Estevam + +commit 38b1f0fb42f772b8c9aac53593883a18ff5eb9d7 upstream. + +The wakeup mechanism via RTSDEN bit relies on the system using the RTS/CTS +lines, so only allow such wakeup method when the system actually has +RTS/CTS support. + +Fixes: bc85734b126f ("serial: imx: allow waking up on RTSD") +Signed-off-by: Fabio Estevam +Reviewed-by: Martin Kaiser +Acked-by: Fugang Duan +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/imx.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +--- a/drivers/tty/serial/imx.c ++++ b/drivers/tty/serial/imx.c +@@ -2057,12 +2057,14 @@ static void serial_imx_enable_wakeup(str + val &= ~UCR3_AWAKEN; + writel(val, sport->port.membase + UCR3); + +- val = readl(sport->port.membase + UCR1); +- if (on) +- val |= UCR1_RTSDEN; +- else +- val &= ~UCR1_RTSDEN; +- writel(val, sport->port.membase + UCR1); ++ if (sport->have_rtscts) { ++ val = readl(sport->port.membase + UCR1); ++ if (on) ++ val |= UCR1_RTSDEN; ++ else ++ val &= ~UCR1_RTSDEN; ++ writel(val, sport->port.membase + UCR1); ++ } + } + + static int imx_serial_port_suspend_noirq(struct device *dev) diff --git a/queue-4.4/series b/queue-4.4/series index 01c13ff8695..ff181eab2b7 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -52,3 +52,16 @@ scsi-ufs-ufshcd-fix-potential-null-pointer-dereference-in-ufshcd_config_vreg.pat media-usbtv-add-a-new-usbid.patch usb-gadget-don-t-dereference-g-until-after-it-has-been-null-checked.patch staging-rtl8188eu-fix-incorrect-response-to-siocgiwessid.patch +usb-option-add-support-for-fs040u-modem.patch +usb-serial-pl2303-new-device-id-for-chilitag.patch +usb-cdc-acm-do-not-log-urb-submission-errors-on-disconnect.patch +cdc-acm-apply-quirk-for-card-reader.patch +usb-serial-io_edgeport-fix-possible-sleep-in-atomic.patch +usbip-prevent-bind-loops-on-devices-attached-to-vhci_hcd.patch +usbip-list-don-t-list-devices-attached-to-vhci_hcd.patch +usb-serial-simple-add-motorola-tetra-driver.patch +usb-f_fs-prevent-gadget-unbind-if-it-is-already-unbound.patch +usb-uas-unconditionally-bring-back-host-after-reset.patch +selinux-general-protection-fault-in-sock_has_perm.patch +serial-imx-only-wakeup-via-rtsden-bit-if-the-system-has-rts-cts.patch +spi-imx-do-not-access-registers-while-clocks-disabled.patch diff --git a/queue-4.4/spi-imx-do-not-access-registers-while-clocks-disabled.patch b/queue-4.4/spi-imx-do-not-access-registers-while-clocks-disabled.patch new file mode 100644 index 00000000000..cf8fc775ed4 --- /dev/null +++ b/queue-4.4/spi-imx-do-not-access-registers-while-clocks-disabled.patch @@ -0,0 +1,51 @@ +From d593574aff0ab846136190b1729c151c736727ec Mon Sep 17 00:00:00 2001 +From: Stefan Agner +Date: Sun, 7 Jan 2018 15:05:49 +0100 +Subject: spi: imx: do not access registers while clocks disabled + +From: Stefan Agner + +commit d593574aff0ab846136190b1729c151c736727ec upstream. + +Since clocks are disabled except during message transfer clocks +are also disabled when spi_imx_remove gets called. Accessing +registers leads to a freeeze at least on a i.MX 6ULL. Enable +clocks before disabling accessing the MXC_CSPICTRL register. + +Fixes: 9e556dcc55774 ("spi: spi-imx: only enable the clocks when we start to transfer a message") +Signed-off-by: Stefan Agner +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-imx.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +--- a/drivers/spi/spi-imx.c ++++ b/drivers/spi/spi-imx.c +@@ -1228,12 +1228,23 @@ static int spi_imx_remove(struct platfor + { + struct spi_master *master = platform_get_drvdata(pdev); + struct spi_imx_data *spi_imx = spi_master_get_devdata(master); ++ int ret; + + spi_bitbang_stop(&spi_imx->bitbang); + ++ ret = clk_enable(spi_imx->clk_per); ++ if (ret) ++ return ret; ++ ++ ret = clk_enable(spi_imx->clk_ipg); ++ if (ret) { ++ clk_disable(spi_imx->clk_per); ++ return ret; ++ } ++ + writel(0, spi_imx->base + MXC_CSPICTRL); +- clk_unprepare(spi_imx->clk_ipg); +- clk_unprepare(spi_imx->clk_per); ++ clk_disable_unprepare(spi_imx->clk_ipg); ++ clk_disable_unprepare(spi_imx->clk_per); + spi_imx_sdma_exit(spi_imx); + spi_master_put(master); + diff --git a/queue-4.4/usb-cdc-acm-do-not-log-urb-submission-errors-on-disconnect.patch b/queue-4.4/usb-cdc-acm-do-not-log-urb-submission-errors-on-disconnect.patch new file mode 100644 index 00000000000..76f528e26a9 --- /dev/null +++ b/queue-4.4/usb-cdc-acm-do-not-log-urb-submission-errors-on-disconnect.patch @@ -0,0 +1,40 @@ +From f0386c083c2ce85284dc0b419d7b89c8e567c09f Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 14 Jan 2018 16:09:00 +0100 +Subject: USB: cdc-acm: Do not log urb submission errors on disconnect + +From: Hans de Goede + +commit f0386c083c2ce85284dc0b419d7b89c8e567c09f upstream. + +When disconnected sometimes the cdc-acm driver logs errors like these: + +[20278.039417] cdc_acm 2-2:2.1: urb 9 failed submission with -19 +[20278.042924] cdc_acm 2-2:2.1: urb 10 failed submission with -19 +[20278.046449] cdc_acm 2-2:2.1: urb 11 failed submission with -19 +[20278.049920] cdc_acm 2-2:2.1: urb 12 failed submission with -19 +[20278.053442] cdc_acm 2-2:2.1: urb 13 failed submission with -19 +[20278.056915] cdc_acm 2-2:2.1: urb 14 failed submission with -19 +[20278.060418] cdc_acm 2-2:2.1: urb 15 failed submission with -19 + +Silence these by not logging errors when the result is -ENODEV. + +Signed-off-by: Hans de Goede +Acked-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-acm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -377,7 +377,7 @@ static int acm_submit_read_urb(struct ac + + res = usb_submit_urb(acm->read_urbs[index], mem_flags); + if (res) { +- if (res != -EPERM) { ++ if (res != -EPERM && res != -ENODEV) { + dev_err(&acm->data->dev, + "%s - usb_submit_urb failed: %d\n", + __func__, res); diff --git a/queue-4.4/usb-f_fs-prevent-gadget-unbind-if-it-is-already-unbound.patch b/queue-4.4/usb-f_fs-prevent-gadget-unbind-if-it-is-already-unbound.patch new file mode 100644 index 00000000000..3e678236997 --- /dev/null +++ b/queue-4.4/usb-f_fs-prevent-gadget-unbind-if-it-is-already-unbound.patch @@ -0,0 +1,51 @@ +From ce5bf9a50daf2d9078b505aca1cea22e88ecb94a Mon Sep 17 00:00:00 2001 +From: Hemant Kumar +Date: Tue, 9 Jan 2018 12:30:53 +0530 +Subject: usb: f_fs: Prevent gadget unbind if it is already unbound + +From: Hemant Kumar + +commit ce5bf9a50daf2d9078b505aca1cea22e88ecb94a upstream. + +Upon usb composition switch there is possibility of ep0 file +release happening after gadget driver bind. In case of composition +switch from adb to a non-adb composition gadget will never gets +bound again resulting into failure of usb device enumeration. Fix +this issue by checking FFS_FL_BOUND flag and avoid extra +gadget driver unbind if it is already done as part of composition +switch. + +This fixes adb reconnection error reported on Android running +v4.4 and above kernel versions. Verified on Hikey running vanilla +v4.15-rc7 + few out of tree Mali patches. + +Reviewed-at: https://android-review.googlesource.com/#/c/582632/ + +Cc: Felipe Balbi +Cc: Greg KH +Cc: Michal Nazarewicz +Cc: John Stultz +Cc: Dmitry Shmidt +Cc: Badhri +Cc: Android Kernel Team +Signed-off-by: Hemant Kumar +[AmitP: Cherry-picked it from android-4.14 and updated the commit log] +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/function/f_fs.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/gadget/function/f_fs.c ++++ b/drivers/usb/gadget/function/f_fs.c +@@ -3490,7 +3490,8 @@ static void ffs_closed(struct ffs_data * + ci = opts->func_inst.group.cg_item.ci_parent->ci_parent; + ffs_dev_unlock(); + +- unregister_gadget_item(ci); ++ if (test_bit(FFS_FL_BOUND, &ffs->flags)) ++ unregister_gadget_item(ci); + return; + done: + ffs_dev_unlock(); diff --git a/queue-4.4/usb-option-add-support-for-fs040u-modem.patch b/queue-4.4/usb-option-add-support-for-fs040u-modem.patch new file mode 100644 index 00000000000..7030fcc0122 --- /dev/null +++ b/queue-4.4/usb-option-add-support-for-fs040u-modem.patch @@ -0,0 +1,43 @@ +From 69341bd15018da0a662847e210f9b2380c71e623 Mon Sep 17 00:00:00 2001 +From: OKAMOTO Yoshiaki +Date: Tue, 16 Jan 2018 09:51:17 +0000 +Subject: usb: option: Add support for FS040U modem + +From: OKAMOTO Yoshiaki + +commit 69341bd15018da0a662847e210f9b2380c71e623 upstream. + +FS040U modem is manufactured by omega, and sold by Fujisoft. This patch +adds ID of the modem to use option1 driver. Interface 3 is used as +qmi_wwan, so the interface is ignored. + +Signed-off-by: Yoshiaki Okamoto +Signed-off-by: Hiroyuki Yamamoto +Acked-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -383,6 +383,9 @@ static void option_instat_callback(struc + #define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603 + #define FOUR_G_SYSTEMS_PRODUCT_W100 0x9b01 + ++/* Fujisoft products */ ++#define FUJISOFT_PRODUCT_FS040U 0x9b02 ++ + /* iBall 3.5G connect wireless modem */ + #define IBALL_3_5G_CONNECT 0x9605 + +@@ -1897,6 +1900,8 @@ static const struct usb_device_id option + { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W100), + .driver_info = (kernel_ulong_t)&four_g_w100_blacklist + }, ++ {USB_DEVICE(LONGCHEER_VENDOR_ID, FUJISOFT_PRODUCT_FS040U), ++ .driver_info = (kernel_ulong_t)&net_intf3_blacklist}, + { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) }, + { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, 0x9801, 0xff), + .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, diff --git a/queue-4.4/usb-serial-io_edgeport-fix-possible-sleep-in-atomic.patch b/queue-4.4/usb-serial-io_edgeport-fix-possible-sleep-in-atomic.patch new file mode 100644 index 00000000000..14b8ec2c60a --- /dev/null +++ b/queue-4.4/usb-serial-io_edgeport-fix-possible-sleep-in-atomic.patch @@ -0,0 +1,45 @@ +From c7b8f77872c73f69a16528a9eb87afefcccdc18b Mon Sep 17 00:00:00 2001 +From: Jia-Ju Bai +Date: Wed, 13 Dec 2017 20:34:36 +0800 +Subject: USB: serial: io_edgeport: fix possible sleep-in-atomic + +From: Jia-Ju Bai + +commit c7b8f77872c73f69a16528a9eb87afefcccdc18b upstream. + +According to drivers/usb/serial/io_edgeport.c, the driver may sleep +under a spinlock. +The function call path is: +edge_bulk_in_callback (acquire the spinlock) + process_rcvd_data + process_rcvd_status + change_port_settings + send_iosp_ext_cmd + write_cmd_usb + usb_kill_urb --> may sleep + +To fix it, the redundant usb_kill_urb() is removed from the error path +after usb_submit_urb() fails. + +This possible bug is found by my static analysis tool (DSAC) and checked +by my code review. + +Signed-off-by: Jia-Ju Bai +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/io_edgeport.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/usb/serial/io_edgeport.c ++++ b/drivers/usb/serial/io_edgeport.c +@@ -2219,7 +2219,6 @@ static int write_cmd_usb(struct edgeport + /* something went wrong */ + dev_err(dev, "%s - usb_submit_urb(write command) failed, status = %d\n", + __func__, status); +- usb_kill_urb(urb); + usb_free_urb(urb); + atomic_dec(&CmdUrbs); + return status; diff --git a/queue-4.4/usb-serial-pl2303-new-device-id-for-chilitag.patch b/queue-4.4/usb-serial-pl2303-new-device-id-for-chilitag.patch new file mode 100644 index 00000000000..40c5a924520 --- /dev/null +++ b/queue-4.4/usb-serial-pl2303-new-device-id-for-chilitag.patch @@ -0,0 +1,43 @@ +From d08dd3f3dd2ae351b793fc5b76abdbf0fd317b12 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Thu, 25 Jan 2018 09:48:55 +0100 +Subject: USB: serial: pl2303: new device id for Chilitag +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Greg Kroah-Hartman + +commit d08dd3f3dd2ae351b793fc5b76abdbf0fd317b12 upstream. + +This adds a new device id for Chilitag devices to the pl2303 driver. + +Reported-by: "Chu.Mike [朱堅宜]" +Acked-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/pl2303.c | 1 + + drivers/usb/serial/pl2303.h | 1 + + 2 files changed, 2 insertions(+) + +--- a/drivers/usb/serial/pl2303.c ++++ b/drivers/usb/serial/pl2303.c +@@ -39,6 +39,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_DCU11) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) }, ++ { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_CHILITAG) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, +--- a/drivers/usb/serial/pl2303.h ++++ b/drivers/usb/serial/pl2303.h +@@ -17,6 +17,7 @@ + #define PL2303_PRODUCT_ID_DCU11 0x1234 + #define PL2303_PRODUCT_ID_PHAROS 0xaaa0 + #define PL2303_PRODUCT_ID_RSAQ3 0xaaa2 ++#define PL2303_PRODUCT_ID_CHILITAG 0xaaa8 + #define PL2303_PRODUCT_ID_ALDIGA 0x0611 + #define PL2303_PRODUCT_ID_MMX 0x0612 + #define PL2303_PRODUCT_ID_GPRS 0x0609 diff --git a/queue-4.4/usb-serial-simple-add-motorola-tetra-driver.patch b/queue-4.4/usb-serial-simple-add-motorola-tetra-driver.patch new file mode 100644 index 00000000000..b41e0471236 --- /dev/null +++ b/queue-4.4/usb-serial-simple-add-motorola-tetra-driver.patch @@ -0,0 +1,73 @@ +From 46fe895e22ab3845515ec06b01eaf1282b342e29 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 18 Jan 2018 14:46:41 +1100 +Subject: USB: serial: simple: add Motorola Tetra driver + +From: Johan Hovold + +commit 46fe895e22ab3845515ec06b01eaf1282b342e29 upstream. + +Add new Motorola Tetra (simple) driver for Motorola Solutions TETRA PEI +devices. + +D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=0cad ProdID=9011 Rev=24.16 +S: Manufacturer=Motorola Solutions Inc. +S: Product=Motorola Solutions TETRA PEI interface +C: #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA +I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) +I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) + +Note that these devices do not support the CDC SET_CONTROL_LINE_STATE +request (for any interface). + +Reported-by: Max Schulze +Tested-by: Max Schulze +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/Kconfig | 1 + + drivers/usb/serial/usb-serial-simple.c | 7 +++++++ + 2 files changed, 8 insertions(+) + +--- a/drivers/usb/serial/Kconfig ++++ b/drivers/usb/serial/Kconfig +@@ -63,6 +63,7 @@ config USB_SERIAL_SIMPLE + - Google USB serial devices + - HP4x calculators + - a number of Motorola phones ++ - Motorola Tetra devices + - Novatel Wireless GPS receivers + - Siemens USB/MPI adapter. + - ViVOtech ViVOpay USB device. +--- a/drivers/usb/serial/usb-serial-simple.c ++++ b/drivers/usb/serial/usb-serial-simple.c +@@ -80,6 +80,11 @@ DEVICE(vivopay, VIVOPAY_IDS); + { USB_DEVICE(0x22b8, 0x2c64) } /* Motorola V950 phone */ + DEVICE(moto_modem, MOTO_IDS); + ++/* Motorola Tetra driver */ ++#define MOTOROLA_TETRA_IDS() \ ++ { USB_DEVICE(0x0cad, 0x9011) } /* Motorola Solutions TETRA PEI */ ++DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS); ++ + /* Novatel Wireless GPS driver */ + #define NOVATEL_IDS() \ + { USB_DEVICE(0x09d7, 0x0100) } /* NovAtel FlexPack GPS */ +@@ -110,6 +115,7 @@ static struct usb_serial_driver * const + &google_device, + &vivopay_device, + &moto_modem_device, ++ &motorola_tetra_device, + &novatel_gps_device, + &hp4x_device, + &suunto_device, +@@ -125,6 +131,7 @@ static const struct usb_device_id id_tab + GOOGLE_IDS(), + VIVOPAY_IDS(), + MOTO_IDS(), ++ MOTOROLA_TETRA_IDS(), + NOVATEL_IDS(), + HP4X_IDS(), + SUUNTO_IDS(), diff --git a/queue-4.4/usb-uas-unconditionally-bring-back-host-after-reset.patch b/queue-4.4/usb-uas-unconditionally-bring-back-host-after-reset.patch new file mode 100644 index 00000000000..652aebbbb86 --- /dev/null +++ b/queue-4.4/usb-uas-unconditionally-bring-back-host-after-reset.patch @@ -0,0 +1,66 @@ +From cbeef22fd611c4f47c494b821b2b105b8af970bb Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 11 Jan 2018 13:10:16 +0100 +Subject: usb: uas: unconditionally bring back host after reset + +From: Oliver Neukum + +commit cbeef22fd611c4f47c494b821b2b105b8af970bb upstream. + +Quoting Hans: + +If we return 1 from our post_reset handler, then our disconnect handler +will be called immediately afterwards. Since pre_reset blocks all scsi +requests our disconnect handler will then hang in the scsi_remove_host +call. + +This is esp. bad because our disconnect handler hanging for ever also +stops the USB subsys from enumerating any new USB devices, causes commands +like lsusb to hang, etc. + +In practice this happens when unplugging some uas devices because the hub +code may see the device as needing a warm-reset and calls usb_reset_device +before seeing the disconnect. In this case uas_configure_endpoints fails +with -ENODEV. We do not want to print an error for this, so this commit +also silences the shost_printk for -ENODEV. + +ENDQUOTE + +However, if we do that we better drop any unconditional execution +and report to the SCSI subsystem that we have undergone a reset +but we are not operational now. + +Signed-off-by: Oliver Neukum +Reported-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/uas.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/drivers/usb/storage/uas.c ++++ b/drivers/usb/storage/uas.c +@@ -1052,20 +1052,19 @@ static int uas_post_reset(struct usb_int + return 0; + + err = uas_configure_endpoints(devinfo); +- if (err) { ++ if (err && err != ENODEV) + shost_printk(KERN_ERR, shost, + "%s: alloc streams error %d after reset", + __func__, err); +- return 1; +- } + ++ /* we must unblock the host in every case lest we deadlock */ + spin_lock_irqsave(shost->host_lock, flags); + scsi_report_bus_reset(shost, 0); + spin_unlock_irqrestore(shost->host_lock, flags); + + scsi_unblock_requests(shost); + +- return 0; ++ return err ? 1 : 0; + } + + static int uas_suspend(struct usb_interface *intf, pm_message_t message) diff --git a/queue-4.4/usbip-list-don-t-list-devices-attached-to-vhci_hcd.patch b/queue-4.4/usbip-list-don-t-list-devices-attached-to-vhci_hcd.patch new file mode 100644 index 00000000000..d4c8dd25f88 --- /dev/null +++ b/queue-4.4/usbip-list-don-t-list-devices-attached-to-vhci_hcd.patch @@ -0,0 +1,51 @@ +From ef824501f50846589f02173d73ce3fe6021a9d2a Mon Sep 17 00:00:00 2001 +From: Shuah Khan +Date: Wed, 17 Jan 2018 12:08:03 -0700 +Subject: usbip: list: don't list devices attached to vhci_hcd + +From: Shuah Khan + +commit ef824501f50846589f02173d73ce3fe6021a9d2a upstream. + +usbip host lists devices attached to vhci_hcd on the same server +when user does attach over localhost or specifies the server as the +remote. + +usbip attach -r localhost -b busid +or +usbip attach -r servername (or server IP) + +Fix it to check and not list devices that are attached to vhci_hcd. + +Signed-off-by: Shuah Khan +Signed-off-by: Greg Kroah-Hartman + +--- + tools/usb/usbip/src/usbip_list.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/tools/usb/usbip/src/usbip_list.c ++++ b/tools/usb/usbip/src/usbip_list.c +@@ -180,6 +180,7 @@ static int list_devices(bool parsable) + const char *busid; + char product_name[128]; + int ret = -1; ++ const char *devpath; + + /* Create libudev context. */ + udev = udev_new(); +@@ -202,6 +203,14 @@ static int list_devices(bool parsable) + path = udev_list_entry_get_name(dev_list_entry); + dev = udev_device_new_from_syspath(udev, path); + ++ /* Ignore devices attached to vhci_hcd */ ++ devpath = udev_device_get_devpath(dev); ++ if (strstr(devpath, USBIP_VHCI_DRV_NAME)) { ++ dbg("Skip the device %s already attached to %s\n", ++ devpath, USBIP_VHCI_DRV_NAME); ++ continue; ++ } ++ + /* Get device information. */ + idVendor = udev_device_get_sysattr_value(dev, "idVendor"); + idProduct = udev_device_get_sysattr_value(dev, "idProduct"); diff --git a/queue-4.4/usbip-prevent-bind-loops-on-devices-attached-to-vhci_hcd.patch b/queue-4.4/usbip-prevent-bind-loops-on-devices-attached-to-vhci_hcd.patch new file mode 100644 index 00000000000..f0a1c570bc7 --- /dev/null +++ b/queue-4.4/usbip-prevent-bind-loops-on-devices-attached-to-vhci_hcd.patch @@ -0,0 +1,57 @@ +From ef54cf0c600fb8f5737fb001a9e357edda1a1de8 Mon Sep 17 00:00:00 2001 +From: Shuah Khan +Date: Wed, 17 Jan 2018 12:07:30 -0700 +Subject: usbip: prevent bind loops on devices attached to vhci_hcd + +From: Shuah Khan + +commit ef54cf0c600fb8f5737fb001a9e357edda1a1de8 upstream. + +usbip host binds to devices attached to vhci_hcd on the same server +when user does attach over localhost or specifies the server as the +remote. + +usbip attach -r localhost -b busid +or +usbip attach -r servername (or server IP) + +Unbind followed by bind works, however device is left in a bad state with +accesses via the attached busid result in errors and system hangs during +shutdown. + +Fix it to check and bail out if the device is already attached to vhci_hcd. + +Signed-off-by: Shuah Khan +Signed-off-by: Greg Kroah-Hartman + +--- + tools/usb/usbip/src/usbip_bind.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/tools/usb/usbip/src/usbip_bind.c ++++ b/tools/usb/usbip/src/usbip_bind.c +@@ -144,6 +144,7 @@ static int bind_device(char *busid) + int rc; + struct udev *udev; + struct udev_device *dev; ++ const char *devpath; + + /* Check whether the device with this bus ID exists. */ + udev = udev_new(); +@@ -152,8 +153,16 @@ static int bind_device(char *busid) + err("device with the specified bus ID does not exist"); + return -1; + } ++ devpath = udev_device_get_devpath(dev); + udev_unref(udev); + ++ /* If the device is already attached to vhci_hcd - bail out */ ++ if (strstr(devpath, USBIP_VHCI_DRV_NAME)) { ++ err("bind loop detected: device: %s is attached to %s\n", ++ devpath, USBIP_VHCI_DRV_NAME); ++ return -1; ++ } ++ + rc = unbind_other(busid); + if (rc == UNBIND_ST_FAILED) { + err("could not unbind driver from device on busid %s", busid);