1. 26 5月, 2020 1 次提交
    • S
      HID: sony: Fix for broken buttons on DS3 USB dongles · e72455b8
      Scott Shumate 提交于
      Fix for non-working buttons on knock-off USB dongles for Sony
      controllers. These USB dongles are used to connect older Sony DA/DS1/DS2
      controllers via USB and are common on Amazon, AliExpress, etc.  Without
      the patch, the square, X, and circle buttons do not function.  These
      dongles used to work prior to kernel 4.10 but removing the global DS3
      report fixup in commit e19a267b ("HID: sony: DS3 comply to Linux gamepad
      spec") exposed the problem.
      
      Many people reported the problem on the Ubuntu forums and are working
      around the problem by falling back to the 4.9 hid-sony driver.
      
      The problem stems from these dongles incorrectly reporting their button
      count as 13 instead of 16.  This patch fixes up the report descriptor by
      changing the button report count to 16 and removing 3 padding bits.
      
      Cc: stable@vger.kernel.org
      Fixes: e19a267b ("HID: sony: DS3 comply to Linux gamepad spec")
      Signed-off-by: NScott Shumate <scott.shumate@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      e72455b8
  2. 04 10月, 2019 1 次提交
    • A
      HID: Fix assumption that devices have inputs · d9d4b1e4
      Alan Stern 提交于
      The syzbot fuzzer found a slab-out-of-bounds write bug in the hid-gaff
      driver.  The problem is caused by the driver's assumption that the
      device must have an input report.  While this will be true for all
      normal HID input devices, a suitably malicious device can violate the
      assumption.
      
      The same assumption is present in over a dozen other HID drivers.
      This patch fixes them by checking that the list of hid_inputs for the
      hid_device is nonempty before allowing it to be used.
      
      Reported-and-tested-by: syzbot+403741a091bf41d4ae79@syzkaller.appspotmail.com
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      d9d4b1e4
  3. 05 9月, 2019 1 次提交
  4. 06 8月, 2019 1 次提交
    • R
      HID: sony: Fix race condition between rumble and device remove. · e0f6974a
      Roderick Colenbrander 提交于
      Valve reported a kernel crash on Ubuntu 18.04 when disconnecting a DS4
      gamepad while rumble is enabled. This issue is reproducible with a
      frequency of 1 in 3 times in the game Borderlands 2 when using an
      automatic weapon, which triggers many rumble operations.
      
      We found the issue to be a race condition between sony_remove and the
      final device destruction by the HID / input system. The problem was
      that sony_remove didn't clean some of its work_item state in
      "struct sony_sc". After sony_remove work, the corresponding evdev
      node was around for sufficient time for applications to still queue
      rumble work after "sony_remove".
      
      On pre-4.19 kernels the race condition caused a kernel crash due to a
      NULL-pointer dereference as "sc->output_report_dmabuf" got freed during
      sony_remove. On newer kernels this crash doesn't happen due the buffer
      now being allocated using devm_kzalloc. However we can still queue work,
      while the driver is an undefined state.
      
      This patch fixes the described problem, by guarding the work_item
      "state_worker" with an initialized variable, which we are setting back
      to 0 on cleanup.
      Signed-off-by: NRoderick Colenbrander <roderick.colenbrander@sony.com>
      CC: stable@vger.kernel.org
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      e0f6974a
  5. 31 5月, 2019 1 次提交
  6. 09 1月, 2019 2 次提交
  7. 09 7月, 2018 5 次提交
  8. 06 3月, 2018 1 次提交
    • T
      HID: sony: Add touchpad support for NSG-MR5U and NSG-MR7U remotes · b7289cb1
      Todd Kelner 提交于
      Sony's NSG-MR5U and NSG-MR7U remote controls have a full keyboard and a
      touchpad.  The keyboard is already supported by the existing Linux
      kernel and drivers but the touchpad is not recognized.  This patch adds
      the coded needed to bring full functionality to the touchpad.
      
      Note that these remotes use the vendor code for SMK even though they are
      Sony branded.
      
      Known limitations
      - The built-in accelerometers are not supported by these changes
      - When the Drag (Fn) key is used as a mouse button, the button is
      automatically released when the key begins repeating.  There are two
        workarounds for this 1) Use the button behind the touchpad instead of
        the Drag (Fn) key or 2) Disable the key repeat functionality or
        increase the key repeat delay.
      Signed-off-by: NTodd Kelner <tsopdump@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      b7289cb1
  9. 23 1月, 2018 2 次提交
  10. 09 11月, 2017 1 次提交
  11. 06 4月, 2017 7 次提交
  12. 21 3月, 2017 12 次提交
  13. 06 3月, 2017 2 次提交
  14. 19 12月, 2016 3 次提交