]> git.karo-electronics.de Git - karo-tx-linux.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)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 17 Oct 2012 02:48:10 +0000 (03:48 +0100)
commit49167eecdec7620e15678f7a0ac30c4e8e4b32db
tree02bba71b2f5dcb9747466d721c6c600f3a1058ef
parent563ce0476bddbd8e9818c3c7088186dd01479ffe
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/char/ttyprintk.c