Skip to contentSkip to conversation

usb: dwc3: of-simple: fix use-after-free on remove

DISCUSSION Johan Hovold 1 participant 1 message Jun 13, 2018 USB

lore
Share & tools
lore
#0 lore raw
Quoted 12 lines · Felipe Balbi
Quoted 10 lines · Roger Quadros

I'm still trying to get my head around this.

in probe() we do

{
	enable all clocks;
        pm_runtime_set_active(dev);
        pm_runtime_enable(dev);
        pm_runtime_get_sync(dev);
}
Quoted 4 lines
Quoted 2 lines

How will runtime suspend work at all?
We're holding a positive RPM count in probe().

echo auto > /path/to/dwc3/power/control

That makes no difference, user space cannot modify the always-active behaviour given that probe returns with a positive usage count.

Quoted 1 line

Granted, that get_sync() would've been better as a pm_runtime_forbid()

Yeah, that would allow user space some control, albeit in a way that may override a user space configuration (as the platform device would already have been registered).

Why are you trying to prevent runtime pm in the first place? Shouldn't the device be allowed to suspend when it has no active child by default?

Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html