1. 04 Nov, 2022 1 commit
  2. 25 Aug, 2022 2 commits
  3. 08 Jun, 2022 1 commit
    • Maximilian Luz's avatar
      HID: hid-input: add Surface Go battery quirk · db925d80
      Maximilian Luz authored
      
      Similar to the Surface Go (1), the (Elantech) touchscreen/digitizer in
      the Surface Go 2 mistakenly reports the battery of the stylus. Instead
      of over the touchscreen device, battery information is provided via
      bluetooth and the touchscreen device reports an empty battery.
      
      Apply the HID_BATTERY_QUIRK_IGNORE quirk to ignore this battery and
      prevent the erroneous low battery warnings.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMaximilian Luz <luzmaximilian@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      db925d80
  4. 04 Mar, 2022 2 commits
  5. 01 Mar, 2022 6 commits
  6. 12 Jan, 2022 1 commit
    • Karl Kurbjun's avatar
      HID: Ignore battery for Elan touchscreen on HP Envy X360 15t-dr100 · f3193ea1
      Karl Kurbjun authored
      
      Battery status on Elan tablet driver is reported for the HP ENVY x360
      15t-dr100. There is no separate battery for the Elan controller resulting in a
      battery level report of 0% or 1% depending on whether a stylus has interacted
      with the screen. These low battery level reports causes a variety of bad
      behavior in desktop environments. This patch adds the appropriate quirk to
      indicate that the batery status is unused for this target.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarKarl Kurbjun <kkurbjun@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      f3193ea1
  7. 14 Dec, 2021 4 commits
  8. 08 Dec, 2021 1 commit
  9. 19 Nov, 2021 3 commits
  10. 15 Sep, 2021 1 commit
  11. 15 Jul, 2021 1 commit
  12. 24 Jun, 2021 1 commit
  13. 14 Jun, 2021 1 commit
  14. 05 May, 2021 2 commits
  15. 07 Apr, 2021 1 commit
  16. 09 Feb, 2021 1 commit
  17. 02 Feb, 2021 1 commit
    • Dmitry Torokhov's avatar
      HID: hid-input: avoid splitting keyboard, system and consumer controls · 7c7d7ac7
      Dmitry Torokhov authored
      
      A typical USB keyboard usually splits its keys into several reports:
      
      - one for the basic alphanumeric keys, modifier keys, F<n> keys, six pack
        keys and keypad. This report's application is normally listed as
        GenericDesktop.Keyboard
      - a GenericDesktop.SystemControl report for the system control keys, such
        as power and sleep
      - Consumer.ConsumerControl report for multimedia (forward, rewind,
        play/pause, mute, etc) and other extended keys.
      - additional output, vendor specific, and feature reports
      
      Splitting each report into a separate input device is wasteful and even
      hurts userspace as it makes it harder to determine the true capabilities
      (set of available keys) of a keyboard, so let's adjust application
      matching to merge system control and consumer control reports with
      keyboard report, if one has already been processed.
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Acked-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      7c7d7ac7
  18. 08 Jan, 2021 1 commit
  19. 25 Nov, 2020 1 commit
  20. 12 Nov, 2020 1 commit
  21. 29 Oct, 2020 1 commit
  22. 26 Sep, 2020 1 commit
  23. 01 Sep, 2020 1 commit
    • Marc Zyngier's avatar
      HID: core: Sanitize event code and type when mapping input · 35556bed
      Marc Zyngier authored
      
      When calling into hid_map_usage(), the passed event code is
      blindly stored as is, even if it doesn't fit in the associated bitmap.
      
      This event code can come from a variety of sources, including devices
      masquerading as input devices, only a bit more "programmable".
      
      Instead of taking the event code at face value, check that it actually
      fits the corresponding bitmap, and if it doesn't:
      - spit out a warning so that we know which device is acting up
      - NULLify the bitmap pointer so that we catch unexpected uses
      
      Code paths that can make use of untrusted inputs can now check
      that the mapping was indeed correct and bail out if not.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@gmail.com>
      35556bed
  24. 14 Jul, 2020 1 commit
    • Grant Likely's avatar
      HID: input: Fix devices that return multiple bytes in battery report · 4f57cace
      Grant Likely authored
      
      Some devices, particularly the 3DConnexion Spacemouse wireless 3D
      controllers, return more than just the battery capacity in the battery
      report. The Spacemouse devices return an additional byte with a device
      specific field. However, hidinput_query_battery_capacity() only
      requests a 2 byte transfer.
      
      When a spacemouse is connected via USB (direct wire, no wireless dongle)
      and it returns a 3 byte report instead of the assumed 2 byte battery
      report the larger transfer confuses and frightens the USB subsystem
      which chooses to ignore the transfer. Then after 2 seconds assume the
      device has stopped responding and reset it. This can be reproduced
      easily by using a wired connection with a wireless spacemouse. The
      Spacemouse will enter a loop of resetting every 2 seconds which can be
      observed in dmesg.
      
      This patch solves the problem by increasing the transfer request to 4
      bytes instead of 2. The fix isn't particularly elegant, but it is simple
      and safe to backport to stable kernels. A further patch will follow to
      more elegantly handle battery reports that contain additional data.
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Cc: Darren Hart <darren@dvhart.com>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
      Cc: stable@vger.kernel.org
      Tested-by: default avatarDarren Hart <dvhart@infradead.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4f57cace
  25. 16 Jun, 2020 1 commit
    • Peter Hutterer's avatar
      HID: input: do not run GET_REPORT unless there's a Resolution Multiplier · 1ad273d6
      Peter Hutterer authored
      
      hid-multitouch currently runs GET_REPORT for Contact Max and again to
      retrieve the Win8 blob. If both are within the same report, the
      Resolution Multiplier code calls GET_FEATURE again and this time,
      possibly due to timing, it causes the ILITEK-TP device interpret the
      GET_FEATURE as an instruction to change the mode and effectively stop
      the device from functioning as expected.
      
      Notably: the device doesn't even have a Resolution Multiplier so it
      shouldn't be affected by any of this at all.
      
      Fix this by making sure we only execute GET_REPORT if there is
      a Resolution Multiplier in the respective report. Where the
      HID_QUIRK_NO_INIT_REPORTS field is set we just bail out immediately. This
      shouldn't be triggered by any real device anyway.
      Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
      Tested-by: default avatarWen He <wen.he_1@nxp.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      1ad273d6
  26. 13 Dec, 2019 1 commit
    • Dmitry Torokhov's avatar
      HID: hid-input: clear unmapped usages · 4f388217
      Dmitry Torokhov authored
      
      We should not be leaving half-mapped usages with potentially invalid
      keycodes, as that may confuse hidinput_find_key() when the key is located
      by index, which may end up feeding way too large keycode into the VT
      keyboard handler and cause OOB write there:
      
      BUG: KASAN: global-out-of-bounds in clear_bit include/asm-generic/bitops-instrumented.h:56 [inline]
      BUG: KASAN: global-out-of-bounds in kbd_keycode drivers/tty/vt/keyboard.c:1411 [inline]
      BUG: KASAN: global-out-of-bounds in kbd_event+0xe6b/0x3790 drivers/tty/vt/keyboard.c:1495
      Write of size 8 at addr ffffffff89a1b2d8 by task syz-executor108/1722
      ...
       kbd_keycode drivers/tty/vt/keyboard.c:1411 [inline]
       kbd_event+0xe6b/0x3790 drivers/tty/vt/keyboard.c:1495
       input_to_handler+0x3b6/0x4c0 drivers/input/input.c:118
       input_pass_values.part.0+0x2e3/0x720 drivers/input/input.c:145
       input_pass_values drivers/input/input.c:949 [inline]
       input_set_keycode+0x290/0x320 drivers/input/input.c:954
       evdev_handle_set_keycode_v2+0xc4/0x120 drivers/input/evdev.c:882
       evdev_do_ioctl drivers/input/evdev.c:1150 [inline]
      
      Cc: stable@vger.kernel.org
      Reported-by: syzbot+19340dff067c2d3835c0@syzkaller.appspotmail.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Tested-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4f388217
  27. 30 May, 2019 1 commit