Skip to content

Commit 6498086

Browse files
jhovoldgregkh
authored andcommitted
USB: iowarrior: fix NULL-deref in write
commit de46e56653de7b3b54baa625bd582635008b8d05 upstream. Make sure to verify that we have the required interrupt-out endpoint for IOWarrior56 devices to avoid dereferencing a NULL-pointer in write should a malicious device lack such an endpoint. Fixes: 946b960 ("USB: add driver for iowarrior devices.") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 179295c commit 6498086

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/usb/misc/iowarrior.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,14 @@ static int iowarrior_probe(struct usb_interface *interface,
804804
goto error;
805805
}
806806

807+
if (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW56) {
808+
if (!dev->int_out_endpoint) {
809+
dev_err(&interface->dev, "no interrupt-out endpoint found\n");
810+
retval = -ENODEV;
811+
goto error;
812+
}
813+
}
814+
807815
/* we have to check the report_size often, so remember it in the endianness suitable for our machine */
808816
dev->report_size = usb_endpoint_maxp(dev->int_in_endpoint);
809817
if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) &&

0 commit comments

Comments
 (0)