tty: wipe buffer.
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 4 Oct 2018 18:06:13 +0000 (11:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:46:40 +0000 (09:46 +0100)
commit c9a8e5fce009e3c601a43c49ea9dbcb25d1ffac5 upstream.

After we are done with the tty buffer, zero it out.

Reported-by: aszlig <aszlig@nix.build>
Tested-by: Milan Broz <gmazyland@gmail.com>
Tested-by: Daniel Zatovic <daniel.zatovic@gmail.com>
Tested-by: aszlig <aszlig@nix.build>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_buffer.c

index 8f3566cde3eb0d93446aef8e25261035026e03fe..355e9cad680d603b0c8cee69889bd7b579f6f261 100644 (file)
@@ -454,6 +454,8 @@ receive_buf(struct tty_struct *tty, struct tty_buffer *head, int count)
                if (count && disc->ops->receive_buf)
                        disc->ops->receive_buf(tty, p, f, count);
        }
+       if (count > 0)
+               memset(p, 0, count);
        return count;
 }