Alan Stern 0a824efdb7 HID: usbhid: Fix warning caused by 0-length input reports
Syzbot found a warning caused by hid_submit_ctrl() submitting a
control request to transfer a 0-length input report:

	usb 1-1: BOGUS control dir, pipe 80000280 doesn't match bRequestType a1

(The warning message is a little difficult to understand.  It means
that the control request claims to be for an IN transfer but this
contradicts the USB spec, which requires 0-length control transfers
always to be in the OUT direction.)

Now, a zero-length report isn't good for anything and there's no
reason for a device to have one, but the fuzzer likes to pick out
these weird edge cases.  In the future, perhaps we will decide to
reject 0-length reports at probe time.  For now, the simplest approach
for avoiding these warnings is to pretend that the report actually has
length 1.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: syzbot+9b57a46bf1801ce2a2ca@syzkaller.appspotmail.com
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-09-01 20:52:31 +02:00
..
2021-06-30 11:15:39 -07:00
2021-06-24 18:49:01 -06:00
2021-04-18 09:36:56 +03:00
2021-06-29 10:53:50 -07:00
2021-06-12 12:13:55 -07:00
2021-06-29 10:53:48 -07:00
2021-06-16 09:03:52 -07:00
2021-06-28 14:04:24 -07:00
2021-04-26 12:11:52 -07:00
2021-06-30 11:15:39 -07:00
2021-06-29 11:21:35 -07:00
2021-05-01 10:14:08 -07:00
2021-06-29 13:39:41 -07:00
2021-06-30 11:15:39 -07:00
2021-06-18 11:43:09 +02:00
2021-06-14 13:57:39 +02:00
2021-06-30 11:15:39 -07:00
2021-06-28 19:57:00 -07:00
2021-06-29 11:21:35 -07:00
2021-06-29 11:21:35 -07:00
2021-05-05 12:53:16 -07:00
2021-05-04 11:13:33 -07:00
2021-05-05 13:24:11 -07:00
2021-06-01 16:44:09 +01:00
2021-06-29 12:25:04 -07:00
2021-06-28 12:14:19 -07:00
2021-06-29 12:07:18 -07:00
2021-05-05 13:31:39 -07:00
2021-06-16 08:53:58 -06:00
2021-06-29 11:21:35 -07:00