From: Andrew Morton Date: Sun, 30 Oct 2005 23:03:02 +0000 (-0800) Subject: [PATCH] setkeys needs root X-Git-Tag: v2.6.15-rc1~59^2~15^2~58 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b360adbdb54d5b98b78d57ba0916bc4b8871968;p=linux-2.6 [PATCH] setkeys needs root Because people can play games reprogramming keys and leaving traps for the next user of the console. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 1d44f69e1f..003dda147c 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c @@ -192,6 +192,9 @@ do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm) int i, j, k; int ret; + if (!capable(CAP_SYS_TTY_CONFIG)) + return -EPERM; + kbs = kmalloc(sizeof(*kbs), GFP_KERNEL); if (!kbs) { ret = -ENOMEM;