summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-10-04 11:06:13 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-01 09:48:05 +0100
commitc428d528f8a0aa70473cc9a87374ed4ec75626ec (patch)
tree1cb5fbc870ecef06a7346f86127146616b2d0ed0
parentc47386bdb907e89956994212ea1190e117d5cbbf (diff)
downloadlinux-stable-c428d528f8a0aa70473cc9a87374ed4ec75626ec.tar.gz
linux-stable-c428d528f8a0aa70473cc9a87374ed4ec75626ec.tar.bz2
linux-stable-c428d528f8a0aa70473cc9a87374ed4ec75626ec.zip
tty: wipe buffer.
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>
-rw-r--r--drivers/tty/tty_buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index 143deb62467d..0d3fc2dae23a 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -415,6 +415,8 @@ receive_buf(struct tty_struct *tty, struct tty_buffer *head, int count)
disc->ops->receive_buf(tty, p, f, count);
}
head->read += count;
+ if (count > 0)
+ memset(p, 0, count);
return count;
}