summaryrefslogtreecommitdiff
path: root/drivers/usb/image
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2019-10-03 09:09:31 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-17 13:41:01 -0700
commitc841eeea749754ea516130b42d2c9a4d05730eb2 (patch)
treebb580fd21d3667c6efdfc109dd1d09529c9e5dd2 /drivers/usb/image
parent78b2e65cb55f369fccbdc8a42083a4b239005b78 (diff)
USB: microtek: fix info-leak at probe
commit 177238c3d47d54b2ed8f0da7a4290db492f4a057 upstream. Add missing bulk-in endpoint sanity check to prevent uninitialised stack data from being reported to the system log and used as endpoint addresses. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> Reported-by: syzbot+5630ca7c3b2be5c9da5e@syzkaller.appspotmail.com Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Oliver Neukum <oneukum@suse.com> Link: https://lore.kernel.org/r/20191003070931.17009-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/image')
-rw-r--r--drivers/usb/image/microtek.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index a4dbb0cd80da..0fecc002fa9f 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -724,6 +724,10 @@ static int mts_usb_probe(struct usb_interface *intf,
}
+ if (ep_in_current != &ep_in_set[2]) {
+ MTS_WARNING("couldn't find two input bulk endpoints. Bailing out.\n");
+ return -ENODEV;
+ }
if ( ep_out == -1 ) {
MTS_WARNING( "couldn't find an output bulk endpoint. Bailing out.\n" );