diff options
| author | Alan Stern <[email protected]> | 2019-10-28 14:54:26 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2019-10-29 08:56:18 +0000 |
| commit | 54f83b8c8ea9b22082a496deadf90447a326954e (patch) | |
| tree | 30a32b3dfab1c350d4a957cdef6979abe05edcd2 /tools/perf/scripts/python/check-perf-trace.py | |
| parent | UAS: Revert commit 3ae62a42090f ("UAS: fix alignment of scatter/gather segmen... (diff) | |
| download | kernel-54f83b8c8ea9b22082a496deadf90447a326954e.tar.gz kernel-54f83b8c8ea9b22082a496deadf90447a326954e.zip | |
USB: gadget: Reject endpoints with 0 maxpacket value
Endpoints with a maxpacket length of 0 are probably useless. They
can't transfer any data, and it's not at all unlikely that a UDC will
crash or hang when trying to handle a non-zero-length usb_request for
such an endpoint. Indeed, dummy-hcd gets a divide error when trying
to calculate the remainder of a transfer length by the maxpacket
value, as discovered by the syzbot fuzzer.
Currently the gadget core does not check for endpoints having a
maxpacket value of 0. This patch adds a check to usb_ep_enable(),
preventing such endpoints from being used.
As far as I know, none of the gadget drivers in the kernel tries to
create an endpoint with maxpacket = 0, but until now there has been
nothing to prevent userspace programs under gadgetfs or configfs from
doing it.
Signed-off-by: Alan Stern <[email protected]>
Reported-and-tested-by: [email protected]
CC: <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/check-perf-trace.py')
0 files changed, 0 insertions, 0 deletions
