Re: [PATCH] Clean console safely

From: Petr Pisar
Date: Thu Mar 24 2011 - 10:16:13 EST


On Thu, Mar 24, 2011 at 10:24:31AM +0000, Alan Cox wrote:
> On Thu, 24 Mar 2011 10:56:51 +0100
> Petr PÃsaÅ <ppisar@xxxxxxxxxx> wrote:
>
> > Traditional \E[2J sequence erases console display but scroll-back
> > buffer and underlying device (frame) buffer keep data that can be
> > accessed by scrolling console back.
> >
> > This patch introduce new \E[J parameter 3 that allows to scramble
> > scroll-back buffer explicitly. Session locking programs (screen,
> > vlock) can use it to prevent attacker to browse locked console
> > history.
> > ---
> > drivers/tty/vt/vt.c | 6 ++++++
> > 1 files changed, 6 insertions(+), 0 deletions(-)
>
> Looks sensible enough
>
> There are a set of official codes that are probably more relevant, and
> also deal with the timing of events
>
> See DECSR/DECSRC on a later VT terminal, also DECSTR which
>
> DECSR = secure reset, return to power up state, \E[n+p where n is an
> optional value from 1-16383 which if provided is replied back from the tty
> as a DECSRC response (hence 'secure'). It's defined to clear off
> screen memory, and also other weirdness a user may have set up so could
> reasonably also be extended a bit if there is other stuff founbd in
> future that such a reset really ought to clean up - eg for mingetty.
>
> http://www.vt100.net/docs/vt520-rm/ek-vt520-rm.pdf (page 299)
>
> ED 3J looks fine but is a new "made up" extension.
>
The problem with DECSRC as well as DECSTR or RIS is they reset terminal font,
keyboard layout, unicode mode and other configuration. That's the reason why
I rejected enhancing RIS implemented in Linux VT already. In other words,
I'm searching for a clear display feature which preserves configuration.
I read console_codes(4), console_ioctl(4), and now the VT520 documentation and
I did not find any existing control code. The most close seems ED J for me.

-- Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/