Re: use after free in hub_events

2014-09-09 Thread Alan Stern
On Tue, 9 Sep 2014, Alan Stern wrote: > The fix is almost correct. Take the reference when hub_events removes > the hub from hub_event_list, while the hub_event_lock is still held. > That way the get and put occur in the same subroutine, and there's > opportunity for them to become unbalanced

Re: use after free in hub_events

2014-09-09 Thread Alan Stern
On Tue, 9 Sep 2014, Joe Lawrence wrote: ... > hub_events does later go on to check for hub->disconnected, but that's > outside the hub_event_lock and *after* the call to usb_lock_device. In > my traces, that's too late as its already been freed and poisoned. > > There's probably a better way to

use after free in hub_events

2014-09-09 Thread Joe Lawrence
Hello linux-usb, I'd like to report another USB bug that appeared during surprise hotplug device removal. With slub_debug=FZPU set, I would occasionally see the following writes to a poison pattern: = BUG kmalloc-2048 (T