Skip to contentSkip to conversation

Input: pegasus-notetaker - check pipe type when probing

PATCH New Vasiliy Kovalev 1 participant 1 message Apr 7, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: pegasus-notetaker - check pipe type when probing

From: Soumya Negi <[email protected]>

commit b3d80fd27a3c2d8715a40cbf876139b56195f162 upstream.

Fix WARNING in pegasus_open/usb_submit_urb [1]

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.

Fixes 1afca2b66aac ("Input: add Pegasus Notetaker tablet driver")
Reported-and-tested-by [email protected]

[1] Link: https://syzkaller.appspot.com/bug?id=bbc107584dcf3262253ce93183e51f3612aaeb13

[ kovalev: Added the "Fixes" tag and moved the link to the Syzbot report. ]
---
 drivers/input/tablet/pegasus_notetaker.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/input/tablet/pegasus_notetaker.c +6 -0
index 749edbdb7ffa49..e79621fd84af39 100644
@@ -296,6 +296,12 @@ static int pegasus_probe(struct usb_interface *intf,
 	pegasus->intf = intf;
 
 	pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
+	/* Sanity check that pipe's type matches endpoint's type */
+	if (usb_pipe_type_check(dev, pipe)) {
+		error = -EINVAL;
+		goto err_free_mem;
+	}
+
 	pegasus->data_len = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
 
 	pegasus->data = usb_alloc_coherent(dev, pegasus->data_len, GFP_KERNEL,
Signature · 1 line
2.42.2