/[linux-patches]/genpatches-2.6/trunk/2.6.14/1056_4_setkeys-needs-root.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1056_4_setkeys-needs-root.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 232 - (show annotations) (download) (as text)
Thu Dec 15 16:22:43 2005 UTC (14 years, 11 months ago) by dsd
File MIME type: text/x-diff
File size: 1255 byte(s)
Linux 2.6.14.4
1 From stable-bounces@linux.kernel.org Fri Dec 2 13:00:25 2005
2 Message-ID: <4390B4F5.5000907@gentoo.org>
3 Date: Fri, 02 Dec 2005 20:56:21 +0000
4 From: Daniel Drake <dsd@gentoo.org>
5 To: stable@kernel.org
6 Cc: marcelo.tosatti@cyclades.com, mikpe@csd.uu.se
7 Subject: setkeys needs root
8
9 This patch combines commit 0b360adbdb54d5b98b78d57ba0916bc4b8871968 (make
10 setkeys root-only) and commit e3f17f0f6e98f58edb13cb38810d93e6d4808e68 (only
11 disallow setting by users)
12
13 Because people can play games reprogramming keys and leaving traps for the
14 next user of the console.
15
16 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17
18
19 ---
20 drivers/char/vt_ioctl.c | 6 ++++++
21 1 file changed, 6 insertions(+)
22
23 --- linux-2.6.14.3.orig/drivers/char/vt_ioctl.c
24 +++ linux-2.6.14.3/drivers/char/vt_ioctl.c
25 @@ -80,6 +80,9 @@ do_kdsk_ioctl(int cmd, struct kbentry __
26 if (copy_from_user(&tmp, user_kbe, sizeof(struct kbentry)))
27 return -EFAULT;
28
29 + if (!capable(CAP_SYS_TTY_CONFIG))
30 + perm = 0;
31 +
32 switch (cmd) {
33 case KDGKBENT:
34 key_map = key_maps[s];
35 @@ -192,6 +195,9 @@ do_kdgkb_ioctl(int cmd, struct kbsentry
36 int i, j, k;
37 int ret;
38
39 + if (!capable(CAP_SYS_TTY_CONFIG))
40 + perm = 0;
41 +
42 kbs = kmalloc(sizeof(*kbs), GFP_KERNEL);
43 if (!kbs) {
44 ret = -ENOMEM;

  ViewVC Help
Powered by ViewVC 1.1.20