Re: [RFC][PATCH] sysrq-j: emergency shell

From: Vegard Nossum
Date: Sat Nov 22 2008 - 17:49:24 EST


On Sat, Nov 22, 2008 at 8:07 PM, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
>> > It seems that keyboard input will go to the shell only half of the
>> > time; the other half goes to whatever program was running there in
>> > the first place. I tried to kill the other users of the TTY using
>> > TIOCSCTTY, but it seems not to have worked. Any ideas?
>>
>> This should go in together with CVE number attached.
>
> TIOCSTTY isn't supposed to kill anything.

Oops, by killing, I meant simply to take it exclusively:

EPERM, unless the caller is root and arg equals 1, in which case
the tty is stolen, and all processes that had it as controlling
tty lose it.

But I realize that this does not necessarily mean that the other
processes cannot read from or write to the tty anymore. Do you know
how to do that? :-)


Vegard

--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036
--
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/