Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] Only disallow _setting_ of function key string

Mikael Pettersson <mikpe@csd.uu.se> noted that the current 2.6-git (and 2.4)
patch to disallow KDSKBSENT for unpriviledged users should be less restrictive
allowing reading of current function key string entry, but not writing.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Marcelo Tosatti and committed by
Linus Torvalds
e3f17f0f 796f8d9b

+4 -1
+4 -1
drivers/char/vt_ioctl.c
··· 80 80 if (copy_from_user(&tmp, user_kbe, sizeof(struct kbentry))) 81 81 return -EFAULT; 82 82 83 + if (!capable(CAP_SYS_TTY_CONFIG)) 84 + perm = 0; 85 + 83 86 switch (cmd) { 84 87 case KDGKBENT: 85 88 key_map = key_maps[s]; ··· 196 193 int ret; 197 194 198 195 if (!capable(CAP_SYS_TTY_CONFIG)) 199 - return -EPERM; 196 + perm = 0; 200 197 201 198 kbs = kmalloc(sizeof(*kbs), GFP_KERNEL); 202 199 if (!kbs) {