Re: tty: add 'active' sysfs attribute to tty0 and console device

From: Greg KH
Date: Wed Nov 17 2010 - 20:33:49 EST


On Wed, Nov 17, 2010 at 11:56:47PM +0000, Alan Cox wrote:
> > Brilliant conclusion. If you have mounted it, you own it. But you can
> > not make your inactive session mount another new one. It's like this
> > since ages. Hint: try stuff before hitting reply too fast. :)
>
> Except during the window when screen switching, or of course you could
> just ssh in remotely and gdb or similar a process with it as controlling
> tty running on your console and issue a vt switch back, then mount it.
> Ironically the move from a root owned X server has made that much simpler
> to automate, although it was always possible.
>
> Given you can often guess from the idle data if the victim has gone away
> from the box it's not ideal. Even better any mess will appear on my
> display and get hidden when I flip it back.
>
> The only way to stop that is to make use of the display locking facility
> which takes us back where we began in saying that a usable interface is
> going to need to lock the display.
>
> At that point the current console owner has to choose to allow the
> console to be switched which can be limited effectively to physical
> console access and done synchronously. In turn that means to abuse it I
> already have physical access to the other users key so could just as
> easily steal it and the software security is therefore sufficient.

Ok, we are way-off-topic here from the original points.

Which are:
- the existing ioctl is broken and no userspace program can use
it properly, so it might as well be removed.
- Kay's patch is one proposed solution for what userspace is
wanting to learn about ttys. Werner's is another one.

So, what to do?

I can do any one, or multiple things from the following options:

- disable the existing ioctl to return an error so that no new
userspace program starts to use it thinking it is valid
- accept Werner's patch for those who like proc files
- accept Kay's patch

Any suggestions?

thanks,

greg k-h
--
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/