Skip to content

Commit b3d80fd

Browse files
negi-soumyadtor
authored andcommitted
Input: pegasus-notetaker - check pipe type when probing
Fix WARNING in pegasus_open/usb_submit_urb Syzbot bug: https://syzkaller.appspot.com/bug?id=bbc107584dcf3262253ce93183e51f3612aaeb13 Warning raised because pegasus_driver submits transfer request for bogus URB (pipe type does not match endpoint type). Add sanity check at probe time for pipe value extracted from endpoint descriptor. Probe will fail if sanity check fails. Reported-and-tested-by: syzbot+04ee0cb4caccaed12d78@syzkaller.appspotmail.com Signed-off-by: Soumya Negi <soumya.negi97@gmail.com> Link: https://lore.kernel.org/r/20230404074145.11523-1-soumya.negi97@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent cbedf1a commit b3d80fd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/input/tablet/pegasus_notetaker.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ static int pegasus_probe(struct usb_interface *intf,
296296
pegasus->intf = intf;
297297

298298
pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
299+
/* Sanity check that pipe's type matches endpoint's type */
300+
if (usb_pipe_type_check(dev, pipe)) {
301+
error = -EINVAL;
302+
goto err_free_mem;
303+
}
304+
299305
pegasus->data_len = usb_maxpacket(dev, pipe);
300306

301307
pegasus->data = usb_alloc_coherent(dev, pegasus->data_len, GFP_KERNEL,

0 commit comments

Comments
 (0)