projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2374a04
)
vt: keyboard, union perm checks in vt_do_kdgkb_ioctl
author
Jiri Slaby
<jslaby@suse.cz>
Thu, 29 Oct 2020 11:32:19 +0000
(12:32 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 4 Nov 2020 15:43:38 +0000
(16:43 +0100)
Do the permission check on a single place. That is where perm is
really checked.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link:
https://lore.kernel.org/r/20201029113222.32640-14-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/keyboard.c
patch
|
blob
|
history
diff --git
a/drivers/tty/vt/keyboard.c
b/drivers/tty/vt/keyboard.c
index 648bdfb05e25a2a55bc47e0c4c687ac4ff11a08e..1de0d5217aed0bc0c0376e11425938866ef4a0c4 100644
(file)
--- a/
drivers/tty/vt/keyboard.c
+++ b/
drivers/tty/vt/keyboard.c
@@
-2040,9
+2040,6
@@
int vt_do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm)
char *kbs;
int ret;
- if (!capable(CAP_SYS_TTY_CONFIG))
- perm = 0;
-
if (get_user(kb_func, &user_kdgkb->kb_func))
return -EFAULT;
@@
-2067,7
+2064,7
@@
int vt_do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm)
break;
}
case KDSKBSENT:
- if (!perm)
+ if (!perm
|| !capable(CAP_SYS_TTY_CONFIG)
)
return -EPERM;
kbs = strndup_user(user_kdgkb->kb_string,