20 Oct, 2018

1 commit

  • Commit b6cc0ba2cbf4 (HID: add support for Apple Magic Keyboards)
    backported support for the Magic Keyboard over Bluetooth, but did not
    add the BT_VENDOR_ID_APPLE to hid_have_special_driver[] so the hid-apple
    driver is never loaded and Fn key does not work at all.

    Adding BT_VENDOR_ID_APPLE to hid_have_special_driver[] is not needed
    after commit e04a0442d33b (HID: core: remove the absolute need of
    hid_have_special_driver[]), so 4.16 kernels and newer does not need it.

    Fixes: b6cc0ba2cbf4 (HID: add support for Apple Magic Keyboards)
    Bugzilla-id: https://bugzilla.kernel.org/show_bug.cgi?id=99881
    Signed-off-by: Natanael Copa
    Acked-by: Benjamin Tissoires
    Signed-off-by: Greg Kroah-Hartman

    Natanael Copa
     

10 Oct, 2018

3 commits

  • [ Upstream commit ade573eb1e03d1ee5abcb3359b1259469ab6e8ed ]

    Commit b0f847e16c1e ("HID: hid-sensor-hub: Force logical minimum to 1 for
    power and report state") not only replaced the descriptor fixup done for
    devices with the HID_SENSOR_HUB_ENUM_QUIRK with a generic fix, but also
    accidentally removed the unrelated descriptor fixup for the Lenovo ThinkPad
    Helix 2 sensor hub. This commit restores this fixup.

    Restoring this fixup not only fixes the Lenovo ThinkPad Helix 2's sensors,
    but also the Lenovo ThinkPad 8's sensors.

    Fixes: b0f847e16c1e ("HID: hid-sensor-hub: Force logical minimum ...")
    Cc: Srinivas Pandruvada
    Cc: Fernando D S Lima
    Acked-by: Srinivas Pandruvada
    Signed-off-by: Hans de Goede
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • [ Upstream commit 43822c98f2ebb2cbd5e467ab72bbcdae7f0caa22 ]

    Signed-off-by: Harry Mallon
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Harry Mallon
     
  • [ Upstream commit ee345492437043a79db058a3d4f029ebcb52089a ]

    USB device
    Vendor 05ac (Apple)
    Device 026c (Magic Keyboard with Numeric Keypad)

    Bluetooth devices
    Vendor 004c (Apple)
    Device 0267 (Magic Keyboard)
    Device 026c (Magic Keyboard with Numeric Keypad)

    Support already exists for the Magic Keyboard over USB connection.
    Add support for the Magic Keyboard over Bluetooth connection, and for
    the Magic Keyboard with Numeric Keypad over Bluetooth and USB
    connection.

    Signed-off-by: Sean O'Brien
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sean O'Brien
     

04 Oct, 2018

1 commit

  • [ Upstream commit 44d4d51de9a3534a2b63d69efda02a10e66541e4 ]

    When sysfs_create_group fails, the lack of error-handling code may
    cause unexpected results.

    This patch adds error-handling code after calling sysfs_create_group.

    Signed-off-by: Zhouyang Jia
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Zhouyang Jia
     

15 Sep, 2018

1 commit

  • commit 01cffe9ded15c0d664e0beb33c594e00c0d57bba upstream.

    This mouse keep disconnecting in runleve 3 like below, add it needs the
    quirk to mute the anoying messages.

    [ 111.230555] usb 2-2: USB disconnect, device number 6
    [ 112.718156] usb 2-2: new low-speed USB device number 7 using xhci_hcd
    [ 112.941594] usb 2-2: New USB device found, idVendor=03f0, idProduct=094a
    [ 112.984866] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 113.027731] usb 2-2: Product: HP USB Optical Mouse
    [ 113.069977] usb 2-2: Manufacturer: PixArt
    [ 113.113500] input: PixArt HP USB Optical Mouse as /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/0003:03F0:094A.0002/input/input14
    [ 113.156787] hid-generic 0003:03F0:094A.0002: input: USB HID v1.11 Mouse [PixArt HP USB Optical Mouse] on usb-0000:00:14.0-2/input0
    [ 173.262642] usb 2-2: USB disconnect, device number 7
    [ 174.750244] usb 2-2: new low-speed USB device number 8 using xhci_hcd
    [ 174.935740] usb 2-2: New USB device found, idVendor=03f0, idProduct=094a
    [ 174.990435] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 175.014984] usb 2-2: Product: HP USB Optical Mouse
    [ 175.037886] usb 2-2: Manufacturer: PixArt
    [ 175.061794] input: PixArt HP USB Optical Mouse as /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/0003:03F0:094A.0003/input/input15
    [ 175.084946] hid-generic 0003:03F0:094A.0003: input: USB HID v1.11 Mouse [PixArt HP USB Optical Mouse] on usb-0000:00:14.0-2/input0

    Signed-off-by: Dave Young
    Cc: stable@vger.kernel.org
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Greg Kroah-Hartman

    Dave Young
     

24 Aug, 2018

1 commit

  • [ Upstream commit 3b8d573586d1b9dee33edf6cb6f2ca05f4bca568 ]

    The touch sensors on the 2nd-gen Intuos tablets don't use a 4096x4096
    sensor like other similar tablets (3rd-gen Bamboo, Intuos5, etc.).
    The incorrect maximum XY values don't normally affect userspace since
    touch input from these devices is typically relative rather than
    absolute. It does, however, cause problems when absolute distances
    need to be measured, e.g. for gesture recognition. Since the resolution
    of the touch sensor on these devices is 10 units / mm (versus 100 for
    the pen sensor), the proper maximum values can be calculated by simply
    dividing by 10.

    Fixes: b5fd2a3e92 ("Input: wacom - add support for three new Intuos devices")
    Signed-off-by: Jason Gerecke
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jason Gerecke
     

03 Aug, 2018

2 commits

  • [ Upstream commit b3a81b6c4fc6730ac49e20d789a93c0faabafc98 ]

    On many Chromebooks touch devices are multi-sourced; the components are
    electrically compatible and one can be freely swapped for another without
    changing the OS image or firmware.

    To avoid bunch of scary messages when device is not actually present in the
    system let's try testing basic communication with it and if there is no
    response terminate probe early with -ENXIO.

    Signed-off-by: Dmitry Torokhov
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     
  • [ Upstream commit 37e376df5f4993677c33968a0c19b0c5acbf1108 ]

    Add a mapping for Push-To-Talk joystick trigger button.

    Tested on ChromeBox/ChromeBook with various Plantronics devices.

    Signed-off-by: Terry Junge
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Terry Junge
     

11 Jul, 2018

3 commits

  • commit 717adfdaf14704fd3ec7fa2c04520c0723247eac upstream.

    If our length is greater than the size of the buffer, we
    overflow the buffer

    Cc: stable@vger.kernel.org
    Signed-off-by: Daniel Rosenberg
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Daniel Rosenberg
     
  • commit 4f65245f2d178b9cba48350620d76faa4a098841 upstream.

    uref->field_index, uref->usage_index, finfo.field_index and cinfo.index can be
    indirectly controlled by user-space, hence leading to a potential exploitation
    of the Spectre variant 1 vulnerability.

    This issue was detected with the help of Smatch:

    drivers/hid/usbhid/hiddev.c:473 hiddev_ioctl_usage() warn: potential spectre issue 'report->field' (local cap)
    drivers/hid/usbhid/hiddev.c:477 hiddev_ioctl_usage() warn: potential spectre issue 'field->usage' (local cap)
    drivers/hid/usbhid/hiddev.c:757 hiddev_ioctl() warn: potential spectre issue 'report->field' (local cap)
    drivers/hid/usbhid/hiddev.c:801 hiddev_ioctl() warn: potential spectre issue 'hid->collection' (local cap)

    Fix this by sanitizing such structure fields before using them to index
    report->field, field->usage and hid->collection

    Notice that given that speculation windows are large, the policy is
    to kill the speculation on the first load and not worry if it can be
    completed with a dependent load/store [1].

    [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

    Cc: stable@vger.kernel.org
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     
  • commit ef6eaf27274c0351f7059163918f3795da13199c upstream.

    Commit ac75a041048b ("HID: i2c-hid: fix size check and type usage") started
    writing messages when the ret_size is
    Cc: stable@vger.kernel.org
    Signed-off-by: Jason Andryuk
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Jason Andryuk
     

26 Jun, 2018

2 commits

  • commit d471b6b22d37bf9928c6d0202bdaaf76583b8b61 upstream.

    The HID descriptor for the 2nd-gen Intuos Pro large (PTH-860) contains
    a typo which defines an incorrect logical maximum Y value. This causes
    a small portion of the bottom of the tablet to become unusable (both
    because the area is below the "bottom" of the tablet and because
    'wacom_wac_event' ignores out-of-range values). It also results in a
    skewed aspect ratio.

    To fix this, we add a quirk to 'wacom_usage_mapping' which overwrites
    the data with the correct value.

    Signed-off-by: Jason Gerecke
    CC: stable@vger.kernel.org # v4.10+
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Jason Gerecke
     
  • commit ebeaa367548e9e92dd9374b9464ff6e7d157117b upstream.

    Current ISH driver only registers suspend/resume PM callbacks which don't
    support hibernation (suspend to disk). Basically after hiberation, the ISH
    can't resume properly and user may not see sensor events (for example: screen
    rotation may not work).

    User will not see a crash or panic or anything except the following message
    in log:

    hid-sensor-hub 001F:8086:22D8.0001: timeout waiting for response from ISHTP device

    So this patch adds support for S4/hiberbation to ISH by using the
    SIMPLE_DEV_PM_OPS() MACRO instead of struct dev_pm_ops directly. The suspend
    and resume functions will now be used for both suspend to RAM and hibernation.

    If power management is disabled, SIMPLE_DEV_PM_OPS will do nothing, the suspend
    and resume related functions won't be used, so mark them as __maybe_unused to
    clarify that this is the intended behavior, and remove #ifdefs for power
    management.

    Cc: stable@vger.kernel.org
    Signed-off-by: Even Xu
    Acked-by: Srinivas Pandruvada
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Even Xu
     

21 Jun, 2018

3 commits

  • [ Upstream commit a4eb490a41a0da3b1275fc7427084cf9ae2c3c1c ]

    Never directly free @dev after calling device_register(), even
    if it returned an error. Always use put_device() to give up the
    reference initialized.

    Signed-off-by: Arvind Yadav
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Arvind Yadav
     
  • [ Upstream commit 097b8f62dd793e08f1732fc74dbb64596c7fbff9 ]

    Free device resource data, if __wacom_devm_sysfs_create_group
    is not successful.

    Signed-off-by: Arvind Yadav
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Arvind Yadav
     
  • [ Upstream commit a230cd52b8a2be39cd6e9a13b3e62af57f21372a ]

    The IBM/Lenovo Scrollpoint mice feature a trackpoint-like stick instead of a
    scrolling wheel capable of 2-D (vertical+horizontal) scrolling. hid-generic
    does only expose 1-D (vertical) scrolling functionality for these mice. This
    patch adds support for horizontal scrolling for the IBM/Lenovo Scrollpoint mice
    to hid-lenovo.

    [jkosina@suse.cz: remove change versioning from git changelog]
    Signed-off-by: Peter Ganzhorn
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Peter De Wachter
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    pgzh
     

26 Apr, 2018

1 commit

  • [ Upstream commit 7ad81482cad67cbe1ec808490d1ddfc420c42008 ]

    We get the "new_profile_index" value from the mouse device when we're
    handling raw events. Smatch taints it as untrusted data and complains
    that we need a bounds check. This seems like a reasonable warning
    otherwise there is a small read beyond the end of the array.

    Fixes: 0e70f97f257e ("HID: roccat: Add support for Kova[+] mouse")
    Signed-off-by: Dan Carpenter
    Acked-by: Silvan Jegen
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     

24 Apr, 2018

6 commits

  • commit 619d3a2922ce623ca2eca443cc936810d328317c upstream.

    The code path for recent Bluetooth devices omits an exit report which
    resets all the values of the device.

    Fixes: 4922cd26f0 ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface")
    Cc: # 4.11
    Signed-off-by: Aaron Armstrong Skomra
    Reviewed-by: Ping Cheng
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Aaron Armstrong Skomra
     
  • commit a955358d54695e4ad9f7d6489a7ac4d69a8fc711 upstream.

    Doing `ioctl(HIDIOCGFEATURE)` in a tight loop on a hidraw device
    and then disconnecting the device, or unloading the driver, can
    cause a NULL pointer dereference.

    When a hidraw device is destroyed it sets 0 to `dev->exist`.
    Most functions check 'dev->exist' before doing its work, but
    `hidraw_get_report()` was missing that check.

    Cc: stable@vger.kernel.org
    Signed-off-by: Rodrigo Rivas Costa
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Rodrigo Rivas Costa
     
  • commit 2e210bbb7429cdcf1a1a3ad00c1bf98bd9bf2452 upstream.

    The commit 581c4484769e ("HID: input: map digitizer battery usage")
    assumed that devices having input (qas opposed to feature) report for
    battery strength would report the data on their own, without the need to
    be polled by the kernel; unfortunately it is not so. Many wireless mice
    do not send unsolicited reports with battery strength data and have to
    be polled explicitly. As a complication, stylus devices on digitizers
    are not normally connected to the base and thus can not be polled - the
    base can only determine battery strength in the stylus when it is in
    proximity.

    To solve this issue, we add a special flag that tells the kernel
    to avoid polling the device (and expect unsolicited reports) and set it
    when report field with physical usage of digitizer stylus (HID_DG_STYLUS).
    Unless this flag is set, and we have not seen the unsolicited reports,
    the kernel will attempt to poll the device when userspace attempts to
    read "capacity" and "state" attributes of power_supply object
    corresponding to the devices battery.

    Fixes: 581c4484769e ("HID: input: map digitizer battery usage")
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=198095
    Cc: stable@vger.kernel.org
    Reported-and-tested-by: Martin van Es
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     
  • commit 6de0b13cc0b4ba10e98a9263d7a83b940720b77a upstream.

    When size is negative, calling memset will make segment fault.
    Declare the size as type u32 to keep memset safe.

    size in struct hid_report is unsigned, fix return type of
    hid_report_len to u32.

    Cc: stable@vger.kernel.org
    Signed-off-by: Aaron Ma
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Aaron Ma
     
  • commit 3064a03b94e60388f0955fcc29f3e8a978d28f75 upstream.

    Follow the change of return type u32 of hid_report_len,
    fix all the types of variables those get the return value of
    hid_report_len to u32, and all other code already uses u32.

    Cc: stable@vger.kernel.org
    Signed-off-by: Aaron Ma
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Aaron Ma
     
  • commit ac75a041048b8c1f7418e27621ca5efda8571043 upstream.

    When convert char array with signed int, if the inbuf[x] is negative then
    upper bits will be set to 1. Fix this by using u8 instead of char.

    ret_size has to be at least 3, hid_input_report use it after minus 2 bytes.

    Cc: stable@vger.kernel.org
    Signed-off-by: Aaron Ma
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Aaron Ma
     

19 Mar, 2018

2 commits

  • [ Upstream commit 9abd04af951e5734c9d5cfee9b49790844b734cf ]

    ELO devices have one Button usage in GenDesk field, which makes hid-input map
    it to BTN_LEFT; that confuses userspace, which then considers the device to be
    a mouse/touchpad instead of touchscreen.

    Fix that by unmapping BTN_LEFT and keeping only BTN_TOUCH in place.

    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jiri Kosina
     
  • [ Upstream commit 55746d28d66860bccaae20a67b55b9d5db7c14af ]

    Devices in "single finger hybrid mode" will send one report per finger,
    on some devices only the first report of such a multi-packet frame will
    contain a value for BTN_LEFT, in subsequent reports (if multiple fingers
    are down) the value is always 0, causing hid-mt to report BTN_LEFT going
    1 - 0 - 1 - 0 when pressing a clickpad and putting down a second finger.
    This happens for example on USB 0603:0002 mt touchpads.

    This commit fixes this by only reporting non touch fields for the first
    packet of a (possibly) multi-packet frame.

    Signed-off-by: Hans de Goede
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     

28 Feb, 2018

1 commit


17 Feb, 2018

1 commit

  • commit edfc3722cfef4217c7fe92b272cbe0288ba1ff57 upstream.

    The Toshiba Click Mini uses an i2c attached keyboard/touchpad combo
    (single i2c_hid device for both) which has a vid:pid of 04F3:0401,
    which is also used by a bunch of Elan touchpads which are handled by the
    drivers/input/mouse/elan_i2c driver, but that driver deals with pure
    touchpads and does not work for a combo device such as the one on the
    Toshiba Click Mini.

    The combo on the Mini has an ACPI id of ELAN0800, which is not claimed
    by the elan_i2c driver, so check for that and if it is found do not ignore
    the device. This fixes the keyboard/touchpad combo on the Mini not working
    (although with the touchpad in mouse emulation mode).

    Signed-off-by: Hans de Goede
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     

04 Feb, 2018

2 commits

  • commit 403c0f681c1964ff1db8c2fb8de8c4067779d081 upstream.

    Touch toggle softkeys send a '1' while pressed and a '0' while released,
    requring the kernel to keep track of wether touch should be enabled or
    disabled. The code does not handle the state transitions properly,
    however. If the key is pressed repeatedly, the following four states
    of states are cycled through (assuming touch starts out enabled):

    Press: shared->is_touch_on => 0, SW_MUTE_DEVICE => 1
    Release: shared->is_touch_on => 0, SW_MUTE_DEVICE => 1
    Press: shared->is_touch_on => 1, SW_MUTE_DEVICE => 0
    Release: shared->is_touch_on => 1, SW_MUTE_DEVICE => 1

    The hardware always properly enables/disables touch when the key is
    pressed but applications that listen for SW_MUTE_DEVICE events to provide
    feedback about the state will only ever show touch as being enabled while
    the key is held, and only every-other time. This sequence occurs because
    the fallthrough WACOM_HID_WD_TOUCHONOFF case is always handled, and it
    uses the value of the *local* is_touch_on variable as the value to
    report to userspace. The local value is equal to the shared value when
    the button is pressed, but equal to zero when the button is released.

    Reporting the shared value to userspace fixes this problem, but the
    fallthrough case needs to update the shared value in an incompatible
    way (which is why the local variable was introduced in the first place).
    To work around this, we just handle both cases in a single block of code
    and update the shared variable as appropriate.

    Fixes: d793ff8187 ("HID: wacom: generic: support touch on/off softkey")
    Signed-off-by: Jason Gerecke
    Reviewed-by: Aaron Skomra
    Tested-by: Aaron Skomra
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Jason Gerecke
     
  • commit 791ae273731fa85d3332e45064dab177ae663e80 upstream.

    Background: ExpressKey Remotes communicate their events via usb dongle.
    Each dongle can hold up to 5 pairings at one time and one EKR (identified
    by its serial number) can unfortunately be paired with its dongle
    more than once. The pairing takes place in a round-robin fashion.

    Input devices are only created once per EKR, when a new serial number
    is seen in the list of pairings. However, if a device is created for
    a "higher" paring index and subsequently a second pairing occurs at a
    lower pairing index, unpairing the remote with that serial number from
    any pairing index will currently cause a driver crash. This occurs
    infrequently, as two remotes are necessary to trigger this bug and most
    users have only one remote.

    As an illustration, to trigger the bug you need to have two remotes,
    and pair them in this order:

    1. slot 0 -> remote 1 (input device created for remote 1)
    2. slot 1 -> remote 1 (duplicate pairing - no device created)
    3. slot 2 -> remote 1 (duplicate pairing - no device created)
    4. slot 3 -> remote 1 (duplicate pairing - no device created)
    5. slot 4 -> remote 2 (input device created for remote 2)

    6. slot 0 -> remote 2 (1 destroyed and recreated at slot 1)
    7. slot 1 -> remote 2 (1 destroyed and recreated at slot 2)
    8. slot 2 -> remote 2 (1 destroyed and recreated at slot 3)
    9. slot 3 -> remote 2 (1 destroyed and not recreated)
    10. slot 4 -> remote 2 (2 was already in this slot so no changes)

    11. slot 0 -> remote 1 (The current code sees remote 2 was paired over in
    one of the dongle slots it occupied and attempts
    to remove all information about remote 2 [1]. It
    calls wacom_remote_destroy_one for remote 2, but
    the destroy function assumes the lowest index is
    where the remote's input device was created. The
    code "cleans up" the other remote 2 pairings
    including the one which the input device was based
    on, assuming they were were just duplicate
    pairings. However, the cleanup doesn't call the
    devres release function for the input device that
    was created in slot 4).

    This issue is fixed by this commit.

    [1] Remote 2 should subsequently be re-created on the next packet from the
    EKR at the lowest numbered slot that it occupies (here slot 1).

    Fixes: f9036bd43602 ("HID: wacom: EKR: use devres groups to manage resources")
    Signed-off-by: Aaron Armstrong Skomra
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Aaron Armstrong Skomra
     

20 Dec, 2017

1 commit

  • [ Upstream commit 7da85fbf1c87d4f73621e0e7666a3387497075a9 ]

    When everything goes smoothly, ret is set to 0 which makes the function
    to return EIO error.

    Fixes: 8e9faa15469e ("HID: cp2112: fix gpio-callback error handling")
    Signed-off-by: Sébastien Szymanski
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sébastien Szymanski
     

21 Nov, 2017

2 commits

  • commit 885e89f601a52cc6fb025b009df58ba83d142734 upstream.

    The WACOM_PEN_FIELD macro is used to determine if a given HID field should be
    associated with pen input. This field includes several known collection types
    that Wacom pen data is contained in, but the WACOM_HID_WD_PEN application
    collection type is notably missing. This can result in fields within this
    kind of collection being completely ignored by the `wacom_usage_mapping`
    function, preventing the later '*_event' functions from being notified about
    changes to their value.

    Fixes: c9c095874a ("HID: wacom: generic: Support and use 'Custom HID' mode and usages")
    Fixes: ac2423c975 ("HID: wacom: generic: add vendor defined touch")
    Reviewed-by: Ping Cheng
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jason Gerecke
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Jason Gerecke
     
  • commit cde3076bdc38bf436e517a379759a9092c6ffd4f upstream.

    Otherwise, with HIDRAW=n, the probe function crashes because of null
    dereference of hdev->hidraw.

    Fixes: 42cb6b35b9e6 ("HID: cp2112: use proper hidraw name with minor number")
    Signed-off-by: Sébastien Szymanski
    Acked-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Sébastien Szymanski
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

13 Oct, 2017

1 commit


11 Oct, 2017

2 commits

  • In addition to DEFT, Elecom introduced a larger trackball called HUGE, in
    both wired (M-HT1URBK) and wireless (M-HT1DRBK) versions. It has the same
    buttons and behavior as the DEFT. This patch adds the two relevant USB IDs
    to enable operation of the three Fn buttons on the top of the device.

    Cc: Diego Elio Petteno
    Signed-off-by: Alex Manoussakis
    Signed-off-by: Jiri Kosina

    Alex Manoussakis
     
  • The hid descriptor identifies the length and type of subordinate
    descriptors for a device. If the received hid descriptor is smaller than
    the size of the struct hid_descriptor, it is possible to cause
    out-of-bounds.

    In addition, if bNumDescriptors of the hid descriptor have an incorrect
    value, this can also cause out-of-bounds while approaching hdesc->desc[n].

    So check the size of hid descriptor and bNumDescriptors.

    BUG: KASAN: slab-out-of-bounds in usbhid_parse+0x9b1/0xa20
    Read of size 1 at addr ffff88006c5f8edf by task kworker/1:2/1261

    CPU: 1 PID: 1261 Comm: kworker/1:2 Not tainted
    4.14.0-rc1-42251-gebb2c2437d80 #169
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
    Workqueue: usb_hub_wq hub_event
    Call Trace:
    __dump_stack lib/dump_stack.c:16
    dump_stack+0x292/0x395 lib/dump_stack.c:52
    print_address_description+0x78/0x280 mm/kasan/report.c:252
    kasan_report_error mm/kasan/report.c:351
    kasan_report+0x22f/0x340 mm/kasan/report.c:409
    __asan_report_load1_noabort+0x19/0x20 mm/kasan/report.c:427
    usbhid_parse+0x9b1/0xa20 drivers/hid/usbhid/hid-core.c:1004
    hid_add_device+0x16b/0xb30 drivers/hid/hid-core.c:2944
    usbhid_probe+0xc28/0x1100 drivers/hid/usbhid/hid-core.c:1369
    usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361
    really_probe drivers/base/dd.c:413
    driver_probe_device+0x610/0xa00 drivers/base/dd.c:557
    __device_attach_driver+0x230/0x290 drivers/base/dd.c:653
    bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463
    __device_attach+0x26e/0x3d0 drivers/base/dd.c:710
    device_initial_probe+0x1f/0x30 drivers/base/dd.c:757
    bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523
    device_add+0xd0b/0x1660 drivers/base/core.c:1835
    usb_set_configuration+0x104e/0x1870 drivers/usb/core/message.c:1932
    generic_probe+0x73/0xe0 drivers/usb/core/generic.c:174
    usb_probe_device+0xaf/0xe0 drivers/usb/core/driver.c:266
    really_probe drivers/base/dd.c:413
    driver_probe_device+0x610/0xa00 drivers/base/dd.c:557
    __device_attach_driver+0x230/0x290 drivers/base/dd.c:653
    bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463
    __device_attach+0x26e/0x3d0 drivers/base/dd.c:710
    device_initial_probe+0x1f/0x30 drivers/base/dd.c:757
    bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523
    device_add+0xd0b/0x1660 drivers/base/core.c:1835
    usb_new_device+0x7b8/0x1020 drivers/usb/core/hub.c:2457
    hub_port_connect drivers/usb/core/hub.c:4903
    hub_port_connect_change drivers/usb/core/hub.c:5009
    port_event drivers/usb/core/hub.c:5115
    hub_event+0x194d/0x3740 drivers/usb/core/hub.c:5195
    process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119
    worker_thread+0x221/0x1850 kernel/workqueue.c:2253
    kthread+0x3a1/0x470 kernel/kthread.c:231
    ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431

    Cc: stable@vger.kernel.org
    Reported-by: Andrey Konovalov
    Signed-off-by: Jaejoong Kim
    Tested-by: Andrey Konovalov
    Acked-by: Alan Stern
    Signed-off-by: Jiri Kosina

    Jaejoong Kim
     

06 Oct, 2017

1 commit

  • Pull HID subsystem fixes from Jiri Kosina:

    - buffer management size fix for i2c-hid driver, from Adrian Salido

    - tool ID regression fixes for Wacom driver from Jason Gerecke

    - a few small assorted fixes and a few device ID additions

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
    Revert "HID: multitouch: Support ALPS PTP stick with pid 0x120A"
    HID: hidraw: fix power sequence when closing device
    HID: wacom: Always increment hdev refcount within wacom_get_hdev_data
    HID: wacom: generic: Clear ABS_MISC when tool leaves proximity
    HID: wacom: generic: Send MSC_SERIAL and ABS_MISC when leaving prox
    HID: i2c-hid: allocate hid buffers for real worst case
    HID: rmi: Make sure the HID device is opened on resume
    HID: multitouch: Support ALPS PTP stick with pid 0x120A
    HID: multitouch: support buttons and trackpoint on Lenovo X1 Tab Gen2
    HID: wacom: Correct coordinate system of touchring and pen twist
    HID: wacom: Properly report negative values from Intuos Pro 2 Bluetooth
    HID: multitouch: Fix system-control buttons not working
    HID: add multi-input quirk for IDC6680 touchscreen
    HID: wacom: leds: Don't try to control the EKR's read-only LEDs
    HID: wacom: bits shifted too much for 9th and 10th buttons

    Linus Torvalds
     

02 Oct, 2017

2 commits