USB: iowarrior: fix NULL-deref at probe
authorJohan Hovold <johan@kernel.org>
Tue, 7 Mar 2017 15:11:03 +0000 (16:11 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 5 Jun 2017 20:13:52 +0000 (21:13 +0100)
commit6598f3d653a85dccfb4a472504ec6fd12cec8e42
treede1046d9217ee76369f589e1526dd19bc7a88049
parentde6db11230df93fccb6fabb7960bc566706d765d
USB: iowarrior: fix NULL-deref at probe

commit b7321e81fc369abe353cf094d4f0dc2fe11ab95f upstream.

Make sure to check for the required interrupt-in endpoint to avoid
dereferencing a NULL-pointer should a malicious device lack such an
endpoint.

Note that a fairly recent change purported to fix this issue, but added
an insufficient test on the number of endpoints only, a test which can
now be removed.

Fixes: 4ec0ef3a8212 ("USB: iowarrior: fix oops with malicious USB descriptors")
Fixes: 946b960d13c1 ("USB: add driver for iowarrior devices.")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/misc/iowarrior.c