tty: wipe buffer if not echoing data
authorGreg Kroah-Hartman <greg@kroah.com>
Thu, 4 Oct 2018 18:06:14 +0000 (11:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:37:34 +0000 (09:37 +0100)
commit9365cdf8db5139f63ffd51fc2743c90cb95fd991
treecf5dd98342bc66e85b49b5867ec9b89068e7d039
parent5a2261ed3a29a180e006526718acb5712cf5bcc7
tty: wipe buffer if not echoing data

commit b97b3d9fb57860a60592859e332de7759fd54c2e upstream.

If we are not echoing the data to userspace or the console is in icanon
mode, then perhaps it is a "secret" so we should wipe it once we are
done with it.

This mirrors the logic that the audit code has.

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/n_tty.c