Skip to contentSkip to conversation

input: cm109: fix URB submitted while active

PATCH In review Pavel Skripkin 1 participant 3 messages Aug 4, 2021 – Sep 19, 2021

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

PATCH 1/1 input: cm109: fix URB submitted while active

Syzbot reported, that dev->urb_ctl was submitted while active. The problem was in missing validation check. We should check, that dev->urb_ctl is not pending before sumbitting it again.

Fail log:

URB 00000000cfeee59c submitted while active

WARNING: CPU: 1 PID: 8459 at drivers/usb/core/urb.c:378 usb_submit_urb+0x1271/0x1540 drivers/usb/core/urb.c:378
...
Call Trace:
 <IRQ>
 cm109_urb_irq_callback+0x44f/0xaa0 drivers/input/misc/cm109.c:422
 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1656
 usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1726
Reported-and-tested-by [email protected]
Fixes c04148f915e5 ("Input: add driver for USB VoIP phones with CM109 chipset")
---
 drivers/input/misc/cm109.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/cm109.c +1 -1
index f515fae465c3..60bddadbbe3a 100644
@@ -406,7 +406,7 @@ static void cm109_urb_irq_callback(struct urb *urb)
 
 	dev->irq_urb_pending = 0;
 
-	if (likely(!dev->shutdown)) {
+	if (likely(!dev->shutdown) && likely(!dev->ctl_urb_pending)) {
 
 		if (dev->buzzer_state)
 			dev->ctl_data->byte[HID_OR0] |= BUZZER_ON;
Signature · 1 line
2.32.0
#1 lore raw
Quoted 15 lines · Pavel Skripkin

Syzbot reported, that dev->urb_ctl was submitted while active. The problem was in missing validation check. We should check, that dev->urb_ctl is not pending before sumbitting it again.

Fail log:

URB 00000000cfeee59c submitted while active

WARNING: CPU: 1 PID: 8459 at drivers/usb/core/urb.c:378 usb_submit_urb+0x1271/0x1540 drivers/usb/core/urb.c:378
...
Call Trace:
  <IRQ>
  cm109_urb_irq_callback+0x44f/0xaa0 drivers/input/misc/cm109.c:422
  __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1656
  usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1726
Quoted 4 lines
Reported-and-tested-by [email protected]
Fixes c04148f915e5 ("Input: add driver for USB VoIP phones with CM109 chipset")

---

Gentle ping :)

With regards,
Pavel Skripkin

Quoted 17 lines
  drivers/input/misc/cm109.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/cm109.c +1 -1
index f515fae465c3..60bddadbbe3a 100644
@@ -406,7 +406,7 @@ static void cm109_urb_irq_callback(struct urb *urb)
 
  	dev->irq_urb_pending = 0;
 
-	if (likely(!dev->shutdown)) {
+	if (likely(!dev->shutdown) && likely(!dev->ctl_urb_pending)) {
 
  		if (dev->buzzer_state)
  			dev->ctl_data->byte[HID_OR0] |= BUZZER_ON;
#2 lore raw
Quoted 16 lines · Pavel Skripkin
Quoted 15 lines · Pavel Skripkin

Syzbot reported, that dev->urb_ctl was submitted while active. The problem was in missing validation check. We should check, that dev->urb_ctl is not pending before sumbitting it again.

Fail log:

URB 00000000cfeee59c submitted while active

WARNING: CPU: 1 PID: 8459 at drivers/usb/core/urb.c:378 usb_submit_urb+0x1271/0x1540 drivers/usb/core/urb.c:378
...
Call Trace:
  <IRQ>
  cm109_urb_irq_callback+0x44f/0xaa0 drivers/input/misc/cm109.c:422
  __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1656
  usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1726
Quoted 9 lines
Quoted 4 lines
Reported-and-tested-by [email protected]
Fixes c04148f915e5 ("Input: add driver for USB VoIP phones with CM109 chipset")

---

Gentle ping :)

Hi, Dmitry,

did you have a chance to review this one? Thanks :)

With regards,
Pavel Skripkin