From: Greg Kroah-Hartman Date: Mon, 22 May 2017 19:24:52 +0000 (+0200) Subject: 3.18-stable patches X-Git-Tag: v3.18.55~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9cdc855fbc9804f27c5a93e12d49f6bbb0adc9c;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: pid_ns-sleep-in-task_interruptible-in-zap_pid_ns_processes.patch usb-serial-ftdi_sio-add-olimex-arm-usb-tiny-h-pids.patch usb-serial-ftdi_sio-fix-setting-latency-for-unprivileged-users.patch --- diff --git a/queue-3.18/pid_ns-sleep-in-task_interruptible-in-zap_pid_ns_processes.patch b/queue-3.18/pid_ns-sleep-in-task_interruptible-in-zap_pid_ns_processes.patch new file mode 100644 index 00000000000..d1385e6aef1 --- /dev/null +++ b/queue-3.18/pid_ns-sleep-in-task_interruptible-in-zap_pid_ns_processes.patch @@ -0,0 +1,40 @@ +From b9a985db98961ae1ba0be169f19df1c567e4ffe0 Mon Sep 17 00:00:00 2001 +From: "Eric W. Biederman" +Date: Thu, 11 May 2017 18:21:01 -0500 +Subject: pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes + +From: Eric W. Biederman + +commit b9a985db98961ae1ba0be169f19df1c567e4ffe0 upstream. + +The code can potentially sleep for an indefinite amount of time in +zap_pid_ns_processes triggering the hung task timeout, and increasing +the system average. This is undesirable. Sleep with a task state of +TASK_INTERRUPTIBLE instead of TASK_UNINTERRUPTIBLE to remove these +undesirable side effects. + +Apparently under heavy load this has been allowing Chrome to trigger +the hung time task timeout error and cause ChromeOS to reboot. + +Reported-by: Vovo Yang +Reported-by: Guenter Roeck +Tested-by: Guenter Roeck +Fixes: 6347e9009104 ("pidns: guarantee that the pidns init will be the last pidns process reaped") +Signed-off-by: "Eric W. Biederman" +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/pid_namespace.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/pid_namespace.c ++++ b/kernel/pid_namespace.c +@@ -234,7 +234,7 @@ void zap_pid_ns_processes(struct pid_nam + * Make sure they all go away, see free_pid(). + */ + for (;;) { +- set_current_state(TASK_UNINTERRUPTIBLE); ++ set_current_state(TASK_INTERRUPTIBLE); + if (pid_ns->nr_hashed == init_pids) + break; + schedule(); diff --git a/queue-3.18/series b/queue-3.18/series index 42c728cdabc..40ec2ae360d 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -14,3 +14,6 @@ cdc-acm-fix-possible-invalid-access-when-processing-notification.patch of-fix-sparse-warning-in-of_pci_range_parser_one.patch of-fdt-add-missing-allocation-failure-check.patch iio-dac-ad7303-fix-channel-description.patch +pid_ns-sleep-in-task_interruptible-in-zap_pid_ns_processes.patch +usb-serial-ftdi_sio-fix-setting-latency-for-unprivileged-users.patch +usb-serial-ftdi_sio-add-olimex-arm-usb-tiny-h-pids.patch diff --git a/queue-3.18/usb-serial-ftdi_sio-add-olimex-arm-usb-tiny-h-pids.patch b/queue-3.18/usb-serial-ftdi_sio-add-olimex-arm-usb-tiny-h-pids.patch new file mode 100644 index 00000000000..674a94d7864 --- /dev/null +++ b/queue-3.18/usb-serial-ftdi_sio-add-olimex-arm-usb-tiny-h-pids.patch @@ -0,0 +1,55 @@ +From 5f63424ab7daac840df2b12dd5bcc5b38d50f779 Mon Sep 17 00:00:00 2001 +From: Andrey Korolyov +Date: Tue, 16 May 2017 23:54:41 +0300 +Subject: USB: serial: ftdi_sio: add Olimex ARM-USB-TINY(H) PIDs + +From: Andrey Korolyov + +commit 5f63424ab7daac840df2b12dd5bcc5b38d50f779 upstream. + +This patch adds support for recognition of ARM-USB-TINY(H) devices which +are almost identical to ARM-USB-OCD(H) but lacking separate barrel jack +and serial console. + +By suggestion from Johan Hovold it is possible to replace +ftdi_jtag_quirk with a bit more generic construction. Since all +Olimex-ARM debuggers has exactly two ports, we could safely always use +only second port within the debugger family. + +Signed-off-by: Andrey Korolyov +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/ftdi_sio.c | 8 ++++---- + drivers/usb/serial/ftdi_sio_ids.h | 2 ++ + 2 files changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -809,10 +809,10 @@ static const struct usb_device_id id_tab + { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, + { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, +- { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), +- .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, +- { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID), +- .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, ++ { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID, 1) }, ++ { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID, 1) }, ++ { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_PID, 1) }, ++ { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_H_PID, 1) }, + { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -876,6 +876,8 @@ + /* Olimex */ + #define OLIMEX_VID 0x15BA + #define OLIMEX_ARM_USB_OCD_PID 0x0003 ++#define OLIMEX_ARM_USB_TINY_PID 0x0004 ++#define OLIMEX_ARM_USB_TINY_H_PID 0x002a + #define OLIMEX_ARM_USB_OCD_H_PID 0x002b + + /* diff --git a/queue-3.18/usb-serial-ftdi_sio-fix-setting-latency-for-unprivileged-users.patch b/queue-3.18/usb-serial-ftdi_sio-fix-setting-latency-for-unprivileged-users.patch new file mode 100644 index 00000000000..00abcb260af --- /dev/null +++ b/queue-3.18/usb-serial-ftdi_sio-fix-setting-latency-for-unprivileged-users.patch @@ -0,0 +1,47 @@ +From bb246681b3ed0967489a7401ad528c1aaa1a4c2e Mon Sep 17 00:00:00 2001 +From: Anthony Mallet +Date: Fri, 5 May 2017 17:30:16 +0200 +Subject: USB: serial: ftdi_sio: fix setting latency for unprivileged users + +From: Anthony Mallet + +commit bb246681b3ed0967489a7401ad528c1aaa1a4c2e upstream. + +Commit 557aaa7ffab6 ("ft232: support the ASYNC_LOW_LATENCY +flag") enables unprivileged users to set the FTDI latency timer, +but there was a logic flaw that skipped sending the corresponding +USB control message to the device. + +Specifically, the device latency timer would not be updated until next +open, something which was later also inadvertently broken by commit +c19db4c9e49a ("USB: ftdi_sio: set device latency timeout at port +probe"). + +A recent commit c6dce2626606 ("USB: serial: ftdi_sio: fix extreme +low-latency setting") disabled the low-latency mode by default so we now +need this fix to allow unprivileged users to again enable it. + +Signed-off-by: Anthony Mallet +[johan: amend commit message] +Fixes: 557aaa7ffab6 ("ft232: support the ASYNC_LOW_LATENCY flag") +Fixes: c19db4c9e49a ("USB: ftdi_sio: set device latency timeout at port probe"). +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/ftdi_sio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -1506,9 +1506,9 @@ static int set_serial_info(struct tty_st + (new_serial.flags & ASYNC_FLAGS)); + priv->custom_divisor = new_serial.custom_divisor; + ++check_and_exit: + write_latency_timer(port); + +-check_and_exit: + if ((old_priv.flags & ASYNC_SPD_MASK) != + (priv->flags & ASYNC_SPD_MASK)) { + if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)