Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1736323

Re: usb/hid: slab-out-of-bounds read in usbhid_parse

From Jaejoong Kim <climbbb.kim@gmail.com>
Newsgroups linux.kernel
Subject Re: usb/hid: slab-out-of-bounds read in usbhid_parse
Date 2017-09-21 03:50 +0200
Message-ID <urYMN-2yM-1@gated-at.bofh.it> (permalink)
References <urFh7-6BI-1@gated-at.bofh.it> <urPzQ-51E-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Alan

2017-09-21 0:50 GMT+09:00 Alan Stern <stern@rowland.harvard.edu>:
> On Wed, 20 Sep 2017, Kim Jaejoong wrote:
>
>> To. usb & input guys.
>>
>> While dig this report, i was wondering about bNumDescriptors in HID descriptor.
>> HID document from usb.org said, 'this number must be at least one (1)
>> as a Report descriptor will always be present.'
>>
>> There is no mention of the order of class descriptors. Suppose you
>> have a HID device with a report descriptor and a physical descriptor.
>>
>> If you have the following hid descriptor in this case,
>> HID descriptor
>>    bLength: 12
>>    bDescriptor Type: HID
>>    .. skip
>>    bNumDescriptors: 2
>>    bDescriptorType: physical
>>    bDescriptorLength: any
>>    bDescriptorType: Report
>>    bDescriptorLength: any
>>
>> If the order of the report descriptor is the second as above,
>> usbhid_parse () will fail because my patch is only check the first
>> bDescriptor Type.
>> But If the order of the report descriptor is always first, there is no
>> problem. How do you think this?
>
> The descriptors can appear in any order.  You should not assume that
> the report descriptor will always come first.

Thanks for clarifying. I will resend patch with modification.

Jaejoong

>
> Alan Stern
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

usb/hid: slab-out-of-bounds read in usbhid_parse Andrey Konovalov <andreyknvl@google.com> - 2017-09-18 19:40 +0200
  Re: usb/hid: slab-out-of-bounds read in usbhid_parse Kim Jaejoong <climbbb.kim@gmail.com> - 2017-09-19 13:50 +0200
    Re: usb/hid: slab-out-of-bounds read in usbhid_parse Andrey Konovalov <andreyknvl@google.com> - 2017-09-19 14:40 +0200
      Re: usb/hid: slab-out-of-bounds read in usbhid_parse Kim Jaejoong <climbbb.kim@gmail.com> - 2017-09-20 07:00 +0200
        Re: usb/hid: slab-out-of-bounds read in usbhid_parse Andrey Konovalov <andreyknvl@google.com> - 2017-09-20 12:50 +0200
        Re: usb/hid: slab-out-of-bounds read in usbhid_parse Alan Stern <stern@rowland.harvard.edu> - 2017-09-20 18:00 +0200
          Re: usb/hid: slab-out-of-bounds read in usbhid_parse Jaejoong Kim <climbbb.kim@gmail.com> - 2017-09-21 03:50 +0200
            [PATCH] HID: usbhid: fix out-of-bounds bug Jaejoong Kim <climbbb.kim@gmail.com> - 2017-09-26 09:40 +0200
              Re: [PATCH] HID: usbhid: fix out-of-bounds bug Alan Stern <stern@rowland.harvard.edu> - 2017-09-26 16:20 +0200

csiph-web