]> www.infradead.org Git - users/dwmw2/linux.git/commit
media: usb: siano: Fix general protection fault in smsusb
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 7 May 2019 16:39:47 +0000 (12:39 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Jun 2019 07:18:14 +0000 (09:18 +0200)
commit5a7adcda3de26a44fc0fa3f68199358b1527daf4
treec129ea74994442d1b5578000a82634383c5504ac
parenta86fef3f7df963b45d0eb5dfb225e3a69f639fad
media: usb: siano: Fix general protection fault in smsusb

commit 31e0456de5be379b10fea0fa94a681057114a96e upstream.

The syzkaller USB fuzzer found a general-protection-fault bug in the
smsusb part of the Siano DVB driver.  The fault occurs during probe
because the driver assumes without checking that the device has both
IN and OUT endpoints and the IN endpoint is ep1.

By slightly rearranging the driver's initialization code, we can make
the appropriate checks early on and thus avoid the problem.  If the
expected endpoints aren't present, the new code safely returns -ENODEV
from the probe routine.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: syzbot+53f029db71c19a47325a@syzkaller.appspotmail.com
CC: <stable@vger.kernel.org>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/siano/smsusb.c