* Patch "USB: serial: io_ti: fix div-by-zero in set_termios" has been added to the 4.11-stable tree
@ 2017-05-23 12:40 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-05-23 12:40 UTC (permalink / raw)
To: johan, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
USB: serial: io_ti: fix div-by-zero in set_termios
to the 4.11-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-io_ti-fix-div-by-zero-in-set_termios.patch
and it can be found in the queue-4.11 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 6aeb75e6adfaed16e58780309613a578fe1ee90b Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@kernel.org>
Date: Thu, 11 May 2017 11:41:21 +0200
Subject: USB: serial: io_ti: fix div-by-zero in set_termios
From: Johan Hovold <johan@kernel.org>
commit 6aeb75e6adfaed16e58780309613a578fe1ee90b upstream.
Fix a division-by-zero in set_termios when debugging is enabled and a
high-enough speed has been requested so that the divisor value becomes
zero.
Instead of just fixing the offending debug statement, cap the baud rate
at the base as a zero divisor value also appears to crash the firmware.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/io_ti.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2349,8 +2349,11 @@ static void change_port_settings(struct
if (!baud) {
/* pick a default, any default... */
baud = 9600;
- } else
+ } else {
+ /* Avoid a zero divisor. */
+ baud = min(baud, 461550);
tty_encode_baud_rate(tty, baud, baud);
+ }
edge_port->baud_rate = baud;
config->wBaudRate = (__u16)((461550L + baud/2) / baud);
Patches currently in stable-queue which might be from johan@kernel.org are
queue-4.11/usb-serial-io_ti-fix-div-by-zero-in-set_termios.patch
queue-4.11/usb-chaoskey-fix-alea-quirk-on-big-endian-hosts.patch
queue-4.11/usb-hub-fix-non-ss-hub-descriptor-handling.patch
queue-4.11/usb-serial-ftdi_sio-add-olimex-arm-usb-tiny-h-pids.patch
queue-4.11/usb-serial-ftdi_sio-fix-setting-latency-for-unprivileged-users.patch
queue-4.11/usb-iowarrior-fix-info-ioctl-on-big-endian-hosts.patch
queue-4.11/watchdog-pcwd_usb-fix-null-deref-at-probe.patch
queue-4.11/usb-serial-qcserial-add-more-lenovo-em74xx-device-ids.patch
queue-4.11/usb-serial-option-add-telit-me910-support.patch
queue-4.11/net-irda-irda-usb-fix-firmware-name-on-big-endian-hosts.patch
queue-4.11/of-fdt-add-missing-allocation-failure-check.patch
queue-4.11/usbvision-fix-null-deref-at-probe.patch
queue-4.11/usb-serial-mct_u232-fix-big-endian-baud-rate-handling.patch
queue-4.11/usb-ehci-platform-fix-companion-device-leak.patch
queue-4.11/mceusb-fix-null-deref-at-probe.patch
queue-4.11/usb-hub-fix-ss-hub-descriptor-handling.patch
queue-4.11/ath9k_htc-fix-null-deref-at-probe.patch
queue-4.11/usb-musb-fix-trying-to-suspend-while-active-for-otg-configurations.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-05-23 12:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23 12:40 Patch "USB: serial: io_ti: fix div-by-zero in set_termios" has been added to the 4.11-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).