]> www.infradead.org Git - users/jedix/linux-maple.git/commit
TTY: ttyprintk, don't touch behind tty->write_buf
authorJiri Slaby <jslaby@suse.cz>
Tue, 7 Aug 2012 19:47:39 +0000 (21:47 +0200)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Mon, 8 Oct 2012 14:10:48 +0000 (07:10 -0700)
commit9eea2be02e84ac10583ce58c2407d7a74661668c
treef565c2d526274d53834c1bbc9f91396f9150f41d
parentf8e6bd1ad99b480770e74d87834408db826a7747
TTY: ttyprintk, don't touch behind tty->write_buf

commit ee8b593affdf893012e57f4c54a21984d1b0d92e upstream.

If a user provides a buffer larger than a tty->write_buf chunk and
passes '\r' at the end of the buffer, we touch an out-of-bound memory.

Add a check there to prevent this.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Samo Pogacnik <samo_pogacnik@t-2.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/ttyprintk.c