patch "termios, tty/tty_baudrate.c: fix buffer overrun" added to tty-linus
Subsystems (2)
This is a note to let you know that I've just added the patch titled
termios, tty/tty_baudrate.c: fix buffer overrun
to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
Quoted 1 line
From
991a25194097006ec1e0d2e0814ff920e59e3465Mon Sep 17 00:00:00 2001
From: "H. Peter Anvin" <[email protected]>
Date: Mon, 22 Oct 2018 09:19:04 -0700
Subject: termios, tty/tty_baudrate.c: fix buffer overrun
On architectures with CBAUDEX == 0 (Alpha and PowerPC), the code in tty_baudrate.c does not do any limit checking on the tty_baudrate[] array, and in fact a buffer overrun is possible on both architectures. Add a limit check to prevent that situation.
This will be followed by a much bigger cleanup/simplification patch.
--- drivers/tty/tty_baudrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/tty_baudrate.c +2 -2
@@ -77,7 +77,7 @@ speed_t tty_termios_baud_rate(struct ktermios *termios)else cbaud +=15 ; } -return baud_table[cbaud]; +return cbaud >= n_baud_table ?0 : baud_table[cbaud]; }EXPORT_SYMBOL (tty_termios_baud_rate);
@@ -113,7 +113,7 @@ speed_t tty_termios_input_baud_rate(struct ktermios *termios) else cbaud += 15; } -return baud_table[cbaud]; +return cbaud >= n_baud_table ?0 : baud_table[cbaud];#else /* IBSHIFT */ return tty_termios_baud_rate (termios);#endif /* IBSHIFT */
Signature · 1 line
2.19.1