* Patch "serial: omap: Prevent DoS using unprivileged ioctl(TIOCSRS485)" has been added to the 4.4-stable tree
@ 2016-02-24 3:24 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-02-24 3:24 UTC (permalink / raw)
To: peter, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
serial: omap: Prevent DoS using unprivileged ioctl(TIOCSRS485)
to the 4.4-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:
serial-omap-prevent-dos-using-unprivileged-ioctl-tiocsrs485.patch
and it can be found in the queue-4.4 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 308bbc9ab838d0ace0298268c7970ba9513e2c65 Mon Sep 17 00:00:00 2001
From: Peter Hurley <peter@hurleysoftware.com>
Date: Tue, 12 Jan 2016 15:14:46 -0800
Subject: serial: omap: Prevent DoS using unprivileged ioctl(TIOCSRS485)
From: Peter Hurley <peter@hurleysoftware.com>
commit 308bbc9ab838d0ace0298268c7970ba9513e2c65 upstream.
The omap-serial driver emulates RS485 delays using software timers,
but neglects to clamp the input values from the unprivileged
ioctl(TIOCSRS485). Because the software implementation busy-waits,
malicious userspace could stall the cpu for ~49 days.
Clamp the input values to < 100ms.
Fixes: 4a0ac0f55b18 ("OMAP: add RS485 support")
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/omap-serial.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1343,7 +1343,7 @@ static inline void serial_omap_add_conso
/* Enable or disable the rs485 support */
static int
-serial_omap_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf)
+serial_omap_config_rs485(struct uart_port *port, struct serial_rs485 *rs485)
{
struct uart_omap_port *up = to_uart_omap_port(port);
unsigned int mode;
@@ -1356,8 +1356,12 @@ serial_omap_config_rs485(struct uart_por
up->ier = 0;
serial_out(up, UART_IER, 0);
+ /* Clamp the delays to [0, 100ms] */
+ rs485->delay_rts_before_send = min(rs485->delay_rts_before_send, 100U);
+ rs485->delay_rts_after_send = min(rs485->delay_rts_after_send, 100U);
+
/* store new config */
- port->rs485 = *rs485conf;
+ port->rs485 = *rs485;
/*
* Just as a precaution, only allow rs485
Patches currently in stable-queue which might be from peter@hurleysoftware.com are
queue-4.4/staging-speakup-use-tty_ldisc_ref-for-paste-kworker.patch
queue-4.4/pty-make-sure-super_block-is-still-valid-in-final-dev-tty-close.patch
queue-4.4/serial-omap-prevent-dos-using-unprivileged-ioctl-tiocsrs485.patch
queue-4.4/pty-fix-possible-use-after-free-of-tty-driver_data.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-02-24 3:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-24 3:24 Patch "serial: omap: Prevent DoS using unprivileged ioctl(TIOCSRS485)" has been added to the 4.4-stable tree gregkh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.