1. 20 5月, 2014 1 次提交
  2. 05 5月, 2014 1 次提交
  3. 07 4月, 2014 2 次提交
    • B
      HID: core: do not scan constant input report · e24d0d39
      Benjamin Tissoires 提交于
      The Microsoft Surface Type/Touch Cover 2 is a fancy device which advertised
      itself as a multitouch device but with constant input reports.
      This way, hid_scan_report() gives the group MULTITOUCH to it, but
      hid-multitouch can not handle it due to the constant collection ignored
      by hid-input.
      
      To prevent such crap in the future, and while we do not fix this particular
      device, make the scan_report coherent with hid-input.c, and ignore constant
      input reports.
      
      CC: stable@vger.kernel.org # 3.12+
      Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      e24d0d39
    • D
      Revert "HID: microsoft: Add ID's for Surface Type/Touch Cover 2" · f3b0cbce
      Derya 提交于
      This reverts commit 117309c5.
      
      The MS Surface Pro 2 has an USB composite device with 3 interfaces
      - interface 0 - sensor hub
      - interface 1 - wacom digitizer
      - interface 2 - the keyboard cover, if one is attached
      This USB composite device changes it product id dependent on if and which
      keyboard cover is attached. Adding the covers to hid_have_special_driver
      prevents loading the right hid drivers for the other two interfaces, all 3
      get loaded with hid-microsoft. We don't even need hid-microsoft for the
      keyboards. We have to revert this to load the right hid modules for each
      interface.
      
      CC: stable@vger.kernel.org # kernel 3.14 only
      Signed-off-by: NDerya <derya.kiran@yahoo.de>
      Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      f3b0cbce
  4. 25 2月, 2014 1 次提交
  5. 18 2月, 2014 1 次提交
    • D
      HID: add hid-cp2112 driver · e932d817
      David Barksdale 提交于
      This patch adds support for the Silicon Labs CP2112 "Single-Chip HID USB to
      SMBus Master Bridge."
      
      This is a HID device driver which registers as an i2c adapter and gpiochip to
      expose these functions of the CP2112. The customizable USB descriptor fields
      are exposed as sysfs attributes.  The SMBus byte-read, byte-data-read/write,
      and word-data-read transfer modes have been tested by talking to an i2c
      sensor.  The GPIO functions and USB descriptor field programming have also
      been tested.
      Signed-off-by: NDavid Barksdale <dbarksdale@uplogix.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      e932d817
  6. 17 2月, 2014 1 次提交
  7. 16 2月, 2014 1 次提交
  8. 06 2月, 2014 1 次提交
  9. 03 2月, 2014 1 次提交
  10. 28 1月, 2014 1 次提交
  11. 17 1月, 2014 2 次提交
  12. 18 12月, 2013 1 次提交
  13. 16 12月, 2013 1 次提交
  14. 13 12月, 2013 1 次提交
  15. 02 12月, 2013 1 次提交
  16. 21 11月, 2013 1 次提交
  17. 19 11月, 2013 1 次提交
  18. 13 11月, 2013 1 次提交
  19. 11 11月, 2013 1 次提交
    • F
      HID: don't ignore eGalax/D-Wav/EETI HIDs · 95d50b6c
      Forest Bond 提交于
      Certain devices with class HID, protocol None did not work with the HID
      driver at one point, and as a result were bound to usbtouchscreen
      instead as of commit 139ebe8d ("Input: usbtouchscreen - fix eGalax HID
      ignoring").  This change was prompted by the following report:
      
      https://lkml.org/lkml/2009/1/25/127
      
      Unfortunately, the device mentioned in this report is no longer
      available for testing.
      
      We've recently discovered that some devices with class HID, protocol
      None do not work with usbtouchscreen, but do work with usbhid.  Here is
      the report that made this evident:
      
      http://comments.gmane.org/gmane.linux.kernel.input/31710
      
      Driver binding for these devices has flip-flopped a few times, so both
      of the above reports were regressions.
      
      This situation would appear to leave us with no easy way to bind every
      device to the right driver.  However, in my own testing with several
      devices I have not found a device with class HID that does not work with
      the current HID driver.  It is my belief that changes to the HID driver
      since the original report have likely fixed the issue(s) that made it
      unsuitable at the time, and that we should prefer it over usbtouchscreen
      for these devices.  In particular, HID quirks affecting these devices
      were added/removed in the following commits since then:
      
      fe6065dc HID: add multi-input quirk for eGalax Touchcontroller
      77933c35 Merge branch 'egalax' into for-linus
      ebd11fec HID: Add quirk for eGalax touch controler.
      d34c4aa4 HID: add no-get quirk for eGalax touch controller
      
      This patch makes the HID driver no longer ignore eGalax/D-Wav/EETI
      devices with class HID.  If there are in fact devices with class HID
      that still do not work with the HID driver, we will see another round of
      regressions.  In that case I propose we investigate why the device is
      not working with the HID driver rather than re-introduce regressions for
      functioning HID devices by again binding them to usbtouchscreen.
      
      The corresponding change to usbtouchscreen will be made separately.
      Signed-off-by: NForest Bond <forest.bond@rapidrollout.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      95d50b6c
  20. 08 11月, 2013 1 次提交
  21. 30 10月, 2013 2 次提交
  22. 25 10月, 2013 2 次提交
  23. 21 10月, 2013 1 次提交
  24. 18 10月, 2013 1 次提交
    • N
      HID: Fix unit exponent parsing again · ad0e669b
      Nikolai Kondrashov 提交于
      Revert some changes done in 77463838.
      
      Revert all changes done in hidinput_calc_abs_res as it mistakingly used
      "Unit" item exponent nibbles to affect resolution value. This wasn't
      breaking resolution calculation of relevant axes of any existing
      devices, though, as they have only one dimension to their units and thus
      1 in the corresponding nible.
      
      Revert to reading "Unit Exponent" item value as a signed integer in
      hid_parser_global to fix reading specification-complying values. This
      fixes resolution calculation of devices complying to the HID standard,
      including Huion, KYE, Waltop and UC-Logic graphics tablets which have
      their report descriptors fixed by the drivers.
      
      Explanations follow.
      
      There are two "unit exponents" in HID specification and it is important
      not to mix them. One is the global "Unit Exponent" item and another is
      nibble values in the global "Unit" item. See 6.2.2.7 Global Items.
      
      The "Unit Exponent" value is just a signed integer and is used to scale
      the integer resolution unit values, so fractions can be expressed.
      
      The nibbles of "Unit" value are used to select the unit system (nibble
      0), and presence of a particular basic unit type in the unit formula and
      its *exponent* (or power, nibbles 1-6). And yes, the latter is in two
      complement and zero means absence of the unit type.
      
      Taking the representation example of (integer) joules from the
      specification:
      
      [mass(grams)][length(centimeters)^2][time(seconds)^-2] * 10^-7
      
      the "Unit Exponent" would be -7 (or 0xF9, if stored as a byte) and the
      "Unit" value would be 0xE121, signifying:
      
      Nibble  Part        Value   Meaning
      -----   ----        -----   -------
      0       System      1       SI Linear
      1       Length      2       Centimeters^2
      2       Mass        1       Grams
      3       Time        -2      Seconds^-2
      
      To give the resolution in e.g. hundredth of joules the "Unit Exponent"
      item value should have been -9.
      
      See also the examples of "Unit" values for some common units in the same
      chapter.
      
      However, there is a common misunderstanding about the "Unit Exponent"
      value encoding, where it is assumed to be stored the same as nibbles in
      "Unit" item. This is most likely due to the specification being a bit
      vague and overloading the term "unit exponent". This also was and still
      is proliferated by the official "HID Descriptor Tool", which makes this
      mistake and stores "Unit Exponent" as such. This format is also
      mentioned in books such as "USB Complete" and in Microsoft's hardware
      design guides.
      
      As a result many devices currently on the market use this encoding and
      so the driver should support them.
      Signed-off-by: NNikolai Kondrashov <spbnick@gmail.com>
      Acked-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ad0e669b
  25. 09 10月, 2013 1 次提交
  26. 02 10月, 2013 1 次提交
  27. 13 9月, 2013 2 次提交
  28. 04 9月, 2013 1 次提交
  29. 02 9月, 2013 1 次提交
  30. 29 8月, 2013 1 次提交
    • K
      HID: validate HID report id size · 43622021
      Kees Cook 提交于
      The "Report ID" field of a HID report is used to build indexes of
      reports. The kernel's index of these is limited to 256 entries, so any
      malicious device that sets a Report ID greater than 255 will trigger
      memory corruption on the host:
      
      [ 1347.156239] BUG: unable to handle kernel paging request at ffff88094958a878
      [ 1347.156261] IP: [<ffffffff813e4da0>] hid_register_report+0x2a/0x8b
      
      CVE-2013-2888
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: stable@kernel.org
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      43622021
  31. 27 8月, 2013 2 次提交
  32. 26 8月, 2013 1 次提交
  33. 29 7月, 2013 1 次提交
  34. 22 7月, 2013 1 次提交
    • J
      HID: fix data access in implement() · 27ce4050
      Jiri Kosina 提交于
      implement() is setting bytes in LE data stream. In case the data is not
      aligned to 64bits, it reads past the allocated buffer. It doesn't really
      change any value there (it's properly bitmasked), but in case that this
      read past the boundary hits a page boundary, pagefault happens when
      accessing 64bits of 'x' in implement(), and kernel oopses.
      
      This happens much more often when numbered reports are in use, as the
      initial 8bit skip in the buffer makes the whole process work on values
      which are not aligned to 64bits.
      
      This problem dates back to attempts in 2005 and 2006 to make implement()
      and extract() as generic as possible, and even back then the problem
      was realized by Adam Kroperlin, but falsely assumed to be impossible
      to cause any harm:
      
        http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg47690.html
      
      I have made several attempts at fixing it "on the spot" directly in
      implement(), but the results were horrible; the special casing for processing
      last 64bit chunk and switching to different math makes it unreadable mess.
      
      I therefore took a path to allocate a few bytes more which will never make
      it into final report, but are there as a cushion for all the 64bit math
      operations happening in implement() and extract().
      
      All callers of hid_output_report() are converted at the same time to allocate
      the buffer by newly introduced hid_alloc_report_buf() helper.
      
      Bruno noticed that the whole raw_size test can be dropped as well, as
      hid_alloc_report_buf() makes sure that the buffer is always of a proper
      size.
      Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Acked-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      27ce4050