2014-02-06 20:22:10

by Petr Pisar

[permalink] [raw]
Subject: [PATCH] vt: Fix secure clear screen

\E[3J console code (secure clear screen) needs to update_screen(vc)
in order to write-through blanks into off-screen video memory.

This has been removed accidentally in 3.6 by:

commit 81732c3b2fede049a692e58a7ceabb6d18ffb18c
Author: Jean-François Moine <[email protected]>
Date: Thu Sep 6 19:24:13 2012 +0200

tty vt: Fix line garbage in virtual console on command line edition

Signed-off-by: Petr Písař <[email protected]>
---
drivers/tty/vt/vt.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 61b1137..23b5d32 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1164,6 +1164,8 @@ static void csi_J(struct vc_data *vc, int vpar)
scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char,
vc->vc_screenbuf_size >> 1);
set_origin(vc);
+ if (CON_IS_VISIBLE(vc))
+ update_screen(vc);
/* fall through */
case 2: /* erase whole display */
count = vc->vc_cols * vc->vc_rows;
--
1.8.5.3


2014-02-14 10:39:35

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] vt: Fix secure clear screen

Hi!

> \E[3J console code (secure clear screen) needs to update_screen(vc)
> in order to write-through blanks into off-screen video memory.

I guess it is also suitable for stable, right?

Thanks,
Pavel

> This has been removed accidentally in 3.6 by:
>
> commit 81732c3b2fede049a692e58a7ceabb6d18ffb18c
> Author: Jean-François Moine <[email protected]>
> Date: Thu Sep 6 19:24:13 2012 +0200
>
> tty vt: Fix line garbage in virtual console on command line edition
>
> Signed-off-by: Petr Písař <[email protected]>
> ---
> drivers/tty/vt/vt.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 61b1137..23b5d32 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -1164,6 +1164,8 @@ static void csi_J(struct vc_data *vc, int vpar)
> scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char,
> vc->vc_screenbuf_size >> 1);
> set_origin(vc);
> + if (CON_IS_VISIBLE(vc))
> + update_screen(vc);
> /* fall through */
> case 2: /* erase whole display */
> count = vc->vc_cols * vc->vc_rows;

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2014-02-14 14:20:32

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] vt: Fix secure clear screen

On Fri, Feb 14, 2014 at 11:39:30AM +0100, Pavel Machek wrote:
> Hi!
>
> > \E[3J console code (secure clear screen) needs to update_screen(vc)
> > in order to write-through blanks into off-screen video memory.
>
> I guess it is also suitable for stable, right?

I've already marked it as such in my tree.