1. 30 4月, 2020 3 次提交
  2. 29 4月, 2020 1 次提交
    • A
      HID: usbhid: Fix race between usbhid_close() and usbhid_stop() · 0ed08fad
      Alan Stern 提交于
      The syzbot fuzzer discovered a bad race between in the usbhid driver
      between usbhid_stop() and usbhid_close().  In particular,
      usbhid_stop() does:
      
      	usb_free_urb(usbhid->urbin);
      	...
      	usbhid->urbin = NULL; /* don't mess up next start */
      
      and usbhid_close() does:
      
      	usb_kill_urb(usbhid->urbin);
      
      with no mutual exclusion.  If the two routines happen to run
      concurrently so that usb_kill_urb() is called in between the
      usb_free_urb() and the NULL assignment, it will access the
      deallocated urb structure -- a use-after-free bug.
      
      This patch adds a mutex to the usbhid private structure and uses it to
      enforce mutual exclusion of the usbhid_start(), usbhid_stop(),
      usbhid_open() and usbhid_close() callbacks.
      
      Reported-and-tested-by: syzbot+7bf5a7b0f0a1f9446f4c@syzkaller.appspotmail.com
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      0ed08fad
  3. 17 4月, 2020 1 次提交
    • J
      Revert "HID: wacom: generic: read the number of expected touches on a per collection basis" · b43f977d
      Jason Gerecke 提交于
      This reverts commit 15893fa4.
      
      The referenced commit broke pen and touch input for a variety of devices
      such as the Cintiq Pro 32. Affected devices may appear to work normally
      for a short amount of time, but eventually loose track of actual touch
      state and can leave touch arbitration enabled which prevents the pen
      from working. The commit is not itself required for any currently-available
      Bluetooth device, and so we revert it to correct the behavior of broken
      devices.
      
      This breakage occurs due to a mismatch between the order of collections
      and the order of usages on some devices. This commit tries to read the
      contact count before processing events, but will fail if the contact
      count does not occur prior to the first logical finger collection. This
      is the case for devices like the Cintiq Pro 32 which place the contact
      count at the very end of the report.
      
      Without the contact count set, touches will only be partially processed.
      The `wacom_wac_finger_slot` function will not open any slots since the
      number of contacts seen is greater than the expectation of 0, but we will
      still end up calling `input_mt_sync_frame` for each finger anyway. This
      can cause problems for userspace separate from the issue currently taking
      place in the kernel. Only once all of the individual finger collections
      have been processed do we finally get to the enclosing collection which
      contains the contact count. The value ends up being used for the *next*
      report, however.
      
      This delayed use of the contact count can cause the driver to loose track
      of the actual touch state and believe that there are contacts down when
      there aren't. This leaves touch arbitration enabled and prevents the pen
      from working. It can also cause userspace to incorrectly treat single-
      finger input as gestures.
      
      Link: https://github.com/linuxwacom/input-wacom/issues/146Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: NAaron Armstrong Skomra <aaron.skomra@wacom.com>
      Fixes: 15893fa4 ("HID: wacom: generic: read the number of expected touches on a per collection basis")
      Cc: stable@vger.kernel.org # 5.3+
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      b43f977d
  4. 15 4月, 2020 1 次提交
  5. 14 4月, 2020 3 次提交
  6. 03 4月, 2020 1 次提交
  7. 01 4月, 2020 3 次提交
  8. 31 3月, 2020 27 次提交