X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=drivers%2Finput%2Fevdev.c;h=20e3a165989fb943b0ce29a2009120ce86b57f0b;hb=62778ba1aa2589dc78c36a32edc6f5a6ccaf50c6;hp=374f404e81da32592596953b4403fc6571ca9f41;hpb=8b789b7d7e9b12b086d6d2f0759073a11447c7e7;p=deliverable%2Flinux.git diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 374f404e81da..20e3a165989f 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -320,6 +320,7 @@ static long evdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (t < 0 || t >= dev->keycodemax || !dev->keycodesize) return -EINVAL; if (get_user(v, ip + 1)) return -EFAULT; if (v < 0 || v > KEY_MAX) return -EINVAL; + if (v >> (dev->keycodesize * 8)) return -EINVAL; u = SET_INPUT_KEYCODE(dev, t, v); clear_bit(u, dev->keybit); set_bit(v, dev->keybit);