]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
keyboard: integer underflow bug
authorDan Carpenter <error27@gmail.com>
Thu, 3 Mar 2011 16:56:06 +0000 (17:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 30 Apr 2011 14:53:12 +0000 (16:53 +0200)
commit b652277b09d3d030cb074cc6a98ba80b34244c03 upstream.

The "ct" variable should be an unsigned int.  Both struct kbdiacrs
->kb_cnt and struct kbd_data ->accent_table_size are unsigned ints.

Making it signed causes a problem in KBDIACRUC because the user could
set the signed bit and cause a buffer overflow.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/s390/char/keyboard.c

index cee4d4e4242907bb7a917070b0e3ac7b706cb794..1160fca436632f1b07b7978cfa96f11486ee9f6a 100644 (file)
@@ -462,7 +462,8 @@ kbd_ioctl(struct kbd_data *kbd, struct file *file,
          unsigned int cmd, unsigned long arg)
 {
        void __user *argp;
-       int ct, perm;
+       unsigned int ct;
+       int perm;
 
        argp = (void __user *)arg;