Skip to contentSkip to conversation

Shouldn't the ioctl KDSKBMODE only be usable by root?

DISCUSSION Stefan Gast 1 participant 1 message Apr 28, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

I'm a bit confused about the fact that everyone who has access to a virtual console can stop the keyboard from working by using the KDSKBMODE ioctl:

ioctl(fd_to_console_or_tty, KDSKBMODE, K_RAW);

This is a problem because console switching via alt+fx is no longer possible when the keyboard is in raw mode.

Why is everyone permitted to change the keyboard mode? I guess it is because of the unicode support, but couldn't a modified unicode_start script be called by root while running some init script?

The loadkeys (KDSKBENT) and setkeycodes (KDSETKEYCODE) programs fail because of permisson problems when they are called by a non-privileged user. I think that's correct, but an unprivileged user should not be able to make the system unusable by using KDSKBMODE.

Stefan