Re: keyboard raw mode?

Albert D. Cahalan (acahalan@cs.uml.edu)
Mon, 22 Jun 1998 03:16:20 -0400 (EDT)


H. Peter Anvin writes:
>> Mathieu Bouchard writes:
>>
>>> afaik, there is nothing at the kernel level to prevent a crash of the
>>> keyboard when running root or suidroot programs such as the X Server,
>>> DosEmu, SvgaLib-based programs (mostly games and demoscene stuff)...
>>
>> I looked into this a bit. The problem is that keyboard mode is
>> associated with the device, not the file descriptor. It seems that
>> the device does the keyboard code translations before putting data
>> into a TTY flip buffer, from which multiple processes can read the
>> data. To fix, conversion must happen on the other side of the TTY
>> buffer or the TTY buffer must be eliminated AFAIK.
>
> Why?

When raw keyboard mode is set, it must be set for all processes on the tty.
We end up with a lot of ugly "fixes" to deal with this: sometimes people
rely on SysRq, sometimes they run a daemon to check for problems, sometimes
they log in over a network, and sometimes (mostly) they hit the big switch.
It would be better to have the keyboard mode apply to the file descriptor,
so that the mode would be restored when the file descriptor is closed.
(the existing ioctl must remain, but only be used as a default value)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu