Re: [PATCH] USB: fix invalid memory access in hub_activate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 4 Aug 2016, Viresh Kumar wrote:

> > > What about another patch on top of my patch to fix the deadlock?
> > 
> > Or another patch in place of yours to fix both problems.  Has your
> > patch been merged yet?  I don't see it in any of the branches in
> > https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git, and it's
> > not in the current mainline.
> 
> I don't think Greg has applied it yet. Do you want me to send the new patch?

I'm concerned about the locking.  hub_activate needs to be mutually
exclusive with hub_quiesce.  But hub_activate acquire the lock for the
usb_interface, whereas callers of hub_quiesce (like hub_pre_reset and
hub_event) acquire the lock for the usb_device.  I can't remember why I
did it that way.  It looks like hub_activate really should acquire the
usb_device lock.

Also, although this isn't strictly necessary, the early-exit path 
should call usb_autopm_put_interface_async.  Ideally, it should jump 
directly to the end of the routine, where these things are already 
being done.

In short, it appears that fixing this properly requires a series of 3 
patches.  I'd better write them.

Alan Stern

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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux