]> www.infradead.org Git - users/jedix/linux-maple.git/commit
serial: omap: Prevent DoS using unprivileged ioctl(TIOCSRS485)
authorPeter Hurley <peter@hurleysoftware.com>
Tue, 12 Jan 2016 23:14:46 +0000 (15:14 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:44:55 +0000 (15:44 -0700)
commit076832a6f51a552c28a2fed5852452365b10845b
tree7db89d829ffd8dc70cac8d3ba95a03b584bc22d9
parent72c9d8ef6eab5b79d642b9304f19a677cb7957c1
serial: omap: Prevent DoS using unprivileged ioctl(TIOCSRS485)

Orabug: 23330842

[ Upstream commit 308bbc9ab838d0ace0298268c7970ba9513e2c65 ]

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")
Cc: <stable@vger.kernel.org> # 3.12+
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 56819934d6148c68c85eb181f6153b36f028f99c)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/tty/serial/omap-serial.c