<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/hid, branch v3.18.35</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.18.35</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.18.35'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-04-20T05:19:51Z</updated>
<entry>
<title>HID: usbhid: fix inconsistent reset/resume/reset-resume behavior</title>
<updated>2016-04-20T05:19:51Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2016-03-23T16:17:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a57a632774a1918bf3b1e4233cfac5c5ac22af81'/>
<id>urn:sha1:a57a632774a1918bf3b1e4233cfac5c5ac22af81</id>
<content type='text'>
[ Upstream commit 972e6a993f278b416a8ee3ec65475724fc36feb2 ]

The usbhid driver has inconsistently duplicated code in its post-reset,
resume, and reset-resume pathways.

	reset-resume doesn't check HID_STARTED before trying to
	restart the I/O queues.

	resume fails to clear the HID_SUSPENDED flag if HID_STARTED
	isn't set.

	resume calls usbhid_restart_queues() with usbhid-&gt;lock held
	and the others call it without holding the lock.

The first item in particular causes a problem following a reset-resume
if the driver hasn't started up its I/O.  URB submission fails because
usbhid-&gt;urbin is NULL, and this triggers an unending reset-retry loop.

This patch fixes the problem by creating a new subroutine,
hid_restart_io(), to carry out all the common activities.  It also
adds some checks that were missing in the original code:

	After a reset, there's no need to clear any halted endpoints.

	After a resume, if a reset is pending there's no need to
	restart any I/O until the reset is finished.

	After a resume, if the interrupt-IN endpoint is halted there's
	no need to submit the input URB until the halt has been
	cleared.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Daniel Fraga &lt;fragabr@gmail.com&gt;
Tested-by: Daniel Fraga &lt;fragabr@gmail.com&gt;
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>HID: i2c-hid: fix OOB write in i2c_hid_set_or_send_report()</title>
<updated>2016-04-18T12:49:32Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor@chromium.org</email>
</author>
<published>2016-03-14T22:21:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e5190d1af6282c6d8262d059159f6786c374dc5f'/>
<id>urn:sha1:e5190d1af6282c6d8262d059159f6786c374dc5f</id>
<content type='text'>
[ Upstream commit 3b654288b196ceaa156029d9457ccbded0489b98 ]

Even though hid_hw_* checks that passed in data_len is less than
HID_MAX_BUFFER_SIZE it is not enough, as i2c-hid does not necessarily
allocate buffers of HID_MAX_BUFFER_SIZE but rather checks all device
reports and select largest size. In-kernel users normally just send as much
data as report needs, so there is no problem, but hidraw users can do
whatever they please:

BUG: KASAN: slab-out-of-bounds in memcpy+0x34/0x54 at addr ffffffc07135ea80
Write of size 4101 by task syz-executor/8747
CPU: 2 PID: 8747 Comm: syz-executor Tainted: G    BU         3.18.0 #37
Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
Call trace:
[&lt;ffffffc00020ebcc&gt;] dump_backtrace+0x0/0x258 arch/arm64/kernel/traps.c:83
[&lt;ffffffc00020ee40&gt;] show_stack+0x1c/0x2c arch/arm64/kernel/traps.c:172
[&lt;     inline     &gt;] __dump_stack lib/dump_stack.c:15
[&lt;ffffffc001958114&gt;] dump_stack+0x90/0x140 lib/dump_stack.c:50
[&lt;     inline     &gt;] print_error_description mm/kasan/report.c:97
[&lt;     inline     &gt;] kasan_report_error mm/kasan/report.c:278
[&lt;ffffffc0004597dc&gt;] kasan_report+0x268/0x530 mm/kasan/report.c:305
[&lt;ffffffc0004592e8&gt;] __asan_storeN+0x20/0x150 mm/kasan/kasan.c:718
[&lt;ffffffc0004594e0&gt;] memcpy+0x30/0x54 mm/kasan/kasan.c:299
[&lt;ffffffc001306354&gt;] __i2c_hid_command+0x2b0/0x7b4 drivers/hid/i2c-hid/i2c-hid.c:178
[&lt;     inline     &gt;] i2c_hid_set_or_send_report drivers/hid/i2c-hid/i2c-hid.c:321
[&lt;ffffffc0013079a0&gt;] i2c_hid_output_raw_report.isra.2+0x3d4/0x4b8 drivers/hid/i2c-hid/i2c-hid.c:589
[&lt;ffffffc001307ad8&gt;] i2c_hid_output_report+0x54/0x68 drivers/hid/i2c-hid/i2c-hid.c:602
[&lt;     inline     &gt;] hid_hw_output_report include/linux/hid.h:1039
[&lt;ffffffc0012cc7a0&gt;] hidraw_send_report+0x400/0x414 drivers/hid/hidraw.c:154
[&lt;ffffffc0012cc7f4&gt;] hidraw_write+0x40/0x64 drivers/hid/hidraw.c:177
[&lt;ffffffc0004681dc&gt;] vfs_write+0x1d4/0x3cc fs/read_write.c:534
[&lt;     inline     &gt;] SYSC_pwrite64 fs/read_write.c:627
[&lt;ffffffc000468984&gt;] SyS_pwrite64+0xec/0x144 fs/read_write.c:614
Object at ffffffc07135ea80, in cache kmalloc-512
Object allocated with size 268 bytes.

Let's check data length against the buffer size before attempting to copy
data over.

Cc: stable@vger.kernel.org
Reported-by: Alexander Potapenko &lt;glider@google.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@chromium.org&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>HID: multitouch: fix input mode switching on some Elan panels</title>
<updated>2016-04-12T16:10:58Z</updated>
<author>
<name>Benjamin Tissoires</name>
<email>benjamin.tissoires@redhat.com</email>
</author>
<published>2015-12-01T11:41:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5c644d8d287f7eb715449c1243bbecd3604ad093'/>
<id>urn:sha1:5c644d8d287f7eb715449c1243bbecd3604ad093</id>
<content type='text'>
[ Upstream commit 73e7d63efb4d774883a338997943bfa59e127085 ]

as reported by https://bugzilla.kernel.org/show_bug.cgi?id=108481

This bug reports mentions 6d4f5440 ("HID: multitouch: Fetch feature
reports on demand for Win8 devices") as the origin of the problem but this
commit actually masked 2 firmware bugs that are annihilating each other:

The report descriptor declares two features in reports 3 and 5:

0x05, 0x0d,                    // Usage Page (Digitizers)             318
0x09, 0x0e,                    // Usage (Device Configuration)        320
0xa1, 0x01,                    // Collection (Application)            322
0x85, 0x03,                    //  Report ID (3)                      324
0x09, 0x22,                    //  Usage (Finger)                     326
0xa1, 0x00,                    //  Collection (Physical)              328
0x09, 0x52,                    //   Usage (Inputmode)                 330
0x15, 0x00,                    //   Logical Minimum (0)               332
0x25, 0x0a,                    //   Logical Maximum (10)              334
0x75, 0x08,                    //   Report Size (8)                   336
0x95, 0x02,                    //   Report Count (2)                  338
0xb1, 0x02,                    //   Feature (Data,Var,Abs)            340
0xc0,                          //  End Collection                     342
0x09, 0x22,                    //  Usage (Finger)                     343
0xa1, 0x00,                    //  Collection (Physical)              345
0x85, 0x05,                    //   Report ID (5)                     347
0x09, 0x57,                    //   Usage (Surface Switch)            349
0x09, 0x58,                    //   Usage (Button Switch)             351
0x15, 0x00,                    //   Logical Minimum (0)               353
0x75, 0x01,                    //   Report Size (1)                   355
0x95, 0x02,                    //   Report Count (2)                  357
0x25, 0x03,                    //   Logical Maximum (3)               359
0xb1, 0x02,                    //   Feature (Data,Var,Abs)            361
0x95, 0x0e,                    //   Report Count (14)                 363
0xb1, 0x03,                    //   Feature (Cnst,Var,Abs)            365
0xc0,                          //  End Collection                     367

The report ID 3 presents 2 input mode features, while only the first one
is handled by the device. Given that we did not checked if one was
previously assigned, we were dealing with the ignored featured and we
should never have been able to switch this panel into the multitouch mode.

However, the firmware presents an other bugs which allowed 6d4f5440
to counteract the faulty report descriptor. When we request the values
of the feature 5, the firmware answers "03 03 00". The fields are correct
but the report id is wrong. Before 6d4f5440, we retrieved all the features
and injected them in the system. So when we called report 5, we injected
in the system the report 3 with the values "03 00".
Setting the second input mode to 03 in this report changed it to "03 03"
and the touchpad switched to the mt mode. We could have set anything
in the second field because the actual value (the first 03 in this report)
was given by the query of report ID 5.

To sum up: 2 bugs in the firmware were hiding that we were accessing the
wrong feature.

Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>HID: fix hid_ignore_special_drivers module parameter</title>
<updated>2016-04-12T13:16:34Z</updated>
<author>
<name>Benjamin Tissoires</name>
<email>benjamin.tissoires@redhat.com</email>
</author>
<published>2016-02-12T16:10:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=13309bed3ddf6f8a5b91a46bdbaa00b44d78e58e'/>
<id>urn:sha1:13309bed3ddf6f8a5b91a46bdbaa00b44d78e58e</id>
<content type='text'>
[ Upstream commit 4392bf333388cabdad5afe5b1500002d7b9c318e ]

hid_ignore_special_drivers works fine until hid_scan_report autodetects and
reassign devices (for hid-multitouch, hid-microsoft and hid-rmi).

Simplify the handling of the parameter: if it is there, use hid-generic, no
matter what, and if not, scan the device or rely on the hid_have_special_driver
table.

This was detected while trying to disable hid-multitouch on a Surface Pro cover
which prevented to use the keyboard.

Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
CC: stable@vger.kernel.org
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>HID: core: do not scan reports if the group is already set</title>
<updated>2016-04-12T13:16:25Z</updated>
<author>
<name>Benjamin Tissoires</name>
<email>benjamin.tissoires@redhat.com</email>
</author>
<published>2014-09-30T17:18:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=15d4c43031493078c46a754543a96b67358e9940'/>
<id>urn:sha1:15d4c43031493078c46a754543a96b67358e9940</id>
<content type='text'>
[ Upstream commit 9578f41aeaee5010384f4f8484da1566e2ce4901 ]

This allows the transport layer (I have in mind hid-logitech-dj and uhid)
to set the group before it is added to the hid bus. This way, it can
bypass the hid_scan_report() call, and choose in advance which driver
will handle the newly created hid device.

Signed-off-by: Benjamin Tisssoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>HID: usbhid: fix recursive deadlock</title>
<updated>2016-03-13T17:53:42Z</updated>
<author>
<name>Ioan-Adrian Ratiu</name>
<email>adi@adirat.com</email>
</author>
<published>2016-01-29T20:10:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4f4f0fc7ed917093d3868b8f19b1d4286d696b38'/>
<id>urn:sha1:4f4f0fc7ed917093d3868b8f19b1d4286d696b38</id>
<content type='text'>
commit e470127e9606b1fa151c4184243e61296d1e0c0f upstream.

The critical section protected by usbhid-&gt;lock in hid_ctrl() is too
big and because of this it causes a recursive deadlock. "Too big" means
the case statement and the call to hid_input_report() do not need to be
protected by the spinlock (no URB operations are done inside them).

The deadlock happens because in certain rare cases drivers try to grab
the lock while handling the ctrl irq which grabs the lock before them
as described above. For example newer wacom tablets like 056a:033c try
to reschedule proximity reads from wacom_intuos_schedule_prox_event()
calling hid_hw_request() -&gt; usbhid_request() -&gt; usbhid_submit_report()
which tries to grab the usbhid lock already held by hid_ctrl().

There are two ways to get out of this deadlock:
    1. Make the drivers work "around" the ctrl critical region, in the
    wacom case for ex. by delaying the scheduling of the proximity read
    request itself to a workqueue.
    2. Shrink the critical region so the usbhid lock protects only the
    instructions which modify usbhid state, calling hid_input_report()
    with the spinlock unlocked, allowing the device driver to grab the
    lock first, finish and then grab the lock afterwards in hid_ctrl().

This patch implements the 2nd solution.

Signed-off-by: Ioan-Adrian Ratiu &lt;adi@adirat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Jason Gerecke &lt;jason.gerecke@wacom.com&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>HID: quirks: add QUIRK_NOGET for an other TPV touchscreen</title>
<updated>2015-12-03T04:25:16Z</updated>
<author>
<name>Benjamin Tissoires</name>
<email>benjamin.tissoires@redhat.com</email>
</author>
<published>2015-08-21T14:18:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=67d9383a959c8979daec4f8d782550f4c9baac14'/>
<id>urn:sha1:67d9383a959c8979daec4f8d782550f4c9baac14</id>
<content type='text'>
[ Upstream commit c9b57724b38d4c1555ee49418be3d76801e3327c ]

Looks like 0x8882 needs the same quirk than 0x8883.
Given that both devices claim they are "TPV OpticalTouchScreen" rename
the 0x8883 to add its PID in the #define.

Reported-by: Blaine Lee &lt;blaine.j.lee@medtronic.com&gt;
Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>HID: apple: Add support for the 2015 Macbook Pro</title>
<updated>2015-12-03T04:25:01Z</updated>
<author>
<name>Henrik Rydberg</name>
<email>rydberg@bitmath.org</email>
</author>
<published>2015-07-24T21:45:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=572a085cea021117ffc954a75192271561fd9e2e'/>
<id>urn:sha1:572a085cea021117ffc954a75192271561fd9e2e</id>
<content type='text'>
[ Upstream commit a4a2c54560f2c57b88ba0283f141b44f594c2337 ]

This patch adds keyboard support for MacbookPro12,1 as WELLSPRING9
(0x0272, 0x0273, 0x0274). The touchpad is handled in a separate
bcm5974 patch, as usual.

Tested-by: John Horan &lt;knasher@gmail.com&gt;
Tested-by: Jochen Radmacher &lt;jradmacher@gmx.de&gt;
Tested-by: Yang Hongyang &lt;burnef@gmail.com&gt;
Tested-by: Yen-Chin, Lee &lt;coldnew.tw@gmail.com&gt;
Tested-by: George Hilios &lt;ghilios@gmail.com&gt;
Tested-by: Janez Urevc &lt;janez@janezurevc.name&gt;
Signed-off-by: Henrik Rydberg &lt;rydberg@bitmath.org&gt;
Acked-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>HID: usbhid: Fix the check for HID_RESET_PENDING in hid_io_error</title>
<updated>2015-10-28T02:14:45Z</updated>
<author>
<name>Don Zickus</name>
<email>dzickus@redhat.com</email>
</author>
<published>2015-08-10T16:06:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c22fac8485a145a8e8b2634839c7a33bc334d16b'/>
<id>urn:sha1:c22fac8485a145a8e8b2634839c7a33bc334d16b</id>
<content type='text'>
[ Upstream commit 3af4e5a95184d6d3c1c6a065f163faa174a96a1d ]

It was reported that after 10-20 reboots, a usb keyboard plugged
into a docking station would not work unless it was replugged in.

Using usbmon, it turns out the interrupt URBs were streaming with
callback errors of -71 for some reason.  The hid-core.c::hid_io_error was
supposed to retry and then reset, but the reset wasn't really happening.

The check for HID_NO_BANDWIDTH was inverted.  Fix was simple.

Tested by reporter and locally by me by unplugging a keyboard halfway until I
could recreate a stream of errors but no disconnect.

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>HID: usbhid: add Chicony/Pixart usb optical mouse that needs QUIRK_ALWAYS_POLL</title>
<updated>2015-09-27T16:18:52Z</updated>
<author>
<name>Herton R. Krzesinski</name>
<email>herton@redhat.com</email>
</author>
<published>2015-05-21T18:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b8d1382cfdcdc69928afb3afa5a3738e41d4d4c6'/>
<id>urn:sha1:b8d1382cfdcdc69928afb3afa5a3738e41d4d4c6</id>
<content type='text'>
[ Upstream commit 7250dc3fee806eb2b7560ab7d6072302e7ae8cf8 ]

I received a report from an user of following mouse which needs this quirk:

usb 1-1.6: USB disconnect, device number 58
usb 1-1.6: new low speed USB device number 59 using ehci_hcd
usb 1-1.6: New USB device found, idVendor=04f2, idProduct=1053
usb 1-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.6: Product: USB Optical Mouse
usb 1-1.6: Manufacturer: PixArt
usb 1-1.6: configuration #1 chosen from 1 choice
input: PixArt USB Optical Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6/1-1.6:1.0/input/input5887
generic-usb 0003:04F2:1053.16FE: input,hidraw2: USB HID v1.11 Mouse [PixArt USB Optical Mouse] on usb-0000:00:1a.0-1.6/input0

The quirk was tested by the reporter and it fixed the frequent disconnections etc.

[jkosina@suse.cz: reorder the position in hid-ids.h]
Signed-off-by: Herton R. Krzesinski &lt;herton@redhat.com&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
</feed>
