mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
[PATCH] setkeys needs root
This patch combines commit0b360adbdb
(make setkeys root-only) and commite3f17f0f6e
(only disallow setting by users) Because people can play games reprogramming keys and leaving traps for the next user of the console. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
bb4828a25f
commit
6ca4c553e6
1 changed files with 6 additions and 0 deletions
|
@ -80,6 +80,9 @@ do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, struct kbd_str
|
|||
if (copy_from_user(&tmp, user_kbe, sizeof(struct kbentry)))
|
||||
return -EFAULT;
|
||||
|
||||
if (!capable(CAP_SYS_TTY_CONFIG))
|
||||
perm = 0;
|
||||
|
||||
switch (cmd) {
|
||||
case KDGKBENT:
|
||||
key_map = key_maps[s];
|
||||
|
@ -192,6 +195,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))
|
||||
perm = 0;
|
||||
|
||||
kbs = kmalloc(sizeof(*kbs), GFP_KERNEL);
|
||||
if (!kbs) {
|
||||
ret = -ENOMEM;
|
||||
|
|
Loading…
Reference in a new issue