]> Git Repo - J-linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
authorLinus Torvalds <[email protected]>
Tue, 25 Aug 2020 18:13:29 +0000 (11:13 -0700)
committerLinus Torvalds <[email protected]>
Tue, 25 Aug 2020 18:13:29 +0000 (11:13 -0700)
Pull HID fixes from Jiri Kosina:

 - regression fix / revert of a commit that intended to reduce probing
   delay by ~50ms, but introduced a race that causes quite a few devices
   not to enumerate, or get stuck on first IRQ

 - buffer overflow fix in hiddev, from Peilin Ye

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
  Revert "HID: usbhid: do not sleep when opening device"
  HID: hiddev: Fix slab-out-of-bounds write in hiddev_ioctl_usage()
  HID: quirks: Always poll three more Lenovo PixArt mice
  HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON commands
  HID: macally: Constify macally_id_table
  HID: cougar: Constify cougar_id_table

1  2 
drivers/hid/usbhid/hiddev.c

index 7c0752fbfcf77ccb197d9252e96833dfd8627b15,4f97e6c120595666ece1dd8810d0c389ad05ed6e..45e0b1c75cb1129e5fdf7896c5c6264be169e3cd
@@@ -519,12 -519,16 +519,16 @@@ static noinline int hiddev_ioctl_usage(
  
                switch (cmd) {
                case HIDIOCGUSAGE:
+                       if (uref->usage_index >= field->report_count)
+                               goto inval;
                        uref->value = field->value[uref->usage_index];
                        if (copy_to_user(user_arg, uref, sizeof(*uref)))
                                goto fault;
                        goto goodreturn;
  
                case HIDIOCSUSAGE:
+                       if (uref->usage_index >= field->report_count)
+                               goto inval;
                        field->value[uref->usage_index] = uref->value;
                        goto goodreturn;
  
@@@ -781,6 -785,7 +785,6 @@@ static long hiddev_ioctl(struct file *f
                break;
  
        case HIDIOCGUCODE:
 -              /* fall through */
        case HIDIOCGUSAGE:
        case HIDIOCSUSAGE:
        case HIDIOCGUSAGES:
This page took 0.057529 seconds and 4 git commands to generate.