Skip to content

Commit bcfcb7f

Browse files
jhovolddtor
authored andcommitted
Input: pegasus_notetaker - fix endpoint sanity check
The driver was checking the number of endpoints of the first alternate setting instead of the current one, something which could be used by a malicious device (or USB descriptor fuzzer) to trigger a NULL-pointer dereference. Fixes: 1afca2b ("Input: add Pegasus Notetaker tablet driver") Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Martin Kepplinger <martink@posteo.de> Acked-by: Vladis Dronov <vdronov@redhat.com> Link: https://lore.kernel.org/r/20191210113737.4016-2-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 97e24b0 commit bcfcb7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/input/tablet/pegasus_notetaker.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static int pegasus_probe(struct usb_interface *intf,
275275
return -ENODEV;
276276

277277
/* Sanity check that the device has an endpoint */
278-
if (intf->altsetting[0].desc.bNumEndpoints < 1) {
278+
if (intf->cur_altsetting->desc.bNumEndpoints < 1) {
279279
dev_err(&intf->dev, "Invalid number of endpoints\n");
280280
return -EINVAL;
281281
}

0 commit comments

Comments
 (0)