Skip to contentSkip to conversation

musb: potential use after free

PATCH Applied Dan Carpenter 2 participants 2 messages Mar 20, 2010 – Mar 24, 2010

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

PATCH 1/1 musb: potential use after free

We assign "urb->hcpriv = qh;" a few lines down. I'm pretty sure we want it "urb->hcpriv" to be NULL not a freed value.

---
Found with a static checker. I don't have the hardware to test this.

drivers/usb/musb/musb_host.c +1 -0
index dec896e..877d20b 100644
@@ -2042,6 +2042,7 @@ static int musb_urb_enqueue(
 		 * odd, rare, error prone, but legal.
 		 */
 		kfree(qh);
+		qh = NULL;
 		ret = 0;
 	} else
 		ret = musb_schedule(musb, qh,
Applied
#1 lore raw
Quoted 4 lines · ext Dan Carpenter

We assign "urb->hcpriv = qh;" a few lines down. I'm pretty sure we want it "urb->hcpriv" to be NULL not a freed value.

applied, thanks

Signature · 1 line
balbi