Re: [USB] Fix connect/disconnect race

From: Herbert Xu
Date: Mon Dec 01 2003 - 02:19:10 EST


On Sun, Nov 30, 2003 at 09:03:34PM -0500, Pete Zaitcev wrote:
> > This patch was integrated by you in 2.4 six months ago. Unfortunately
> > it never got into 2.5. Without it you can end up with crashes such
> > as http://bugs.debian.org/218670
>
> > --- kernel-source-2.5/drivers/usb/core/hub.c 28 Sep 2003 04:44:16 -0000 1.1.1.15
> > +++ kernel-source-2.5/drivers/usb/core/hub.c 30 Nov 2003 07:44:40 -0000
> > break;
> > }
> >
> > - hub->children[port] = dev;
> > dev->state = USB_STATE_POWERED;
> >[...]
> > /* Run it through the hoops (find a driver, etc) */
> > - if (!usb_new_device(dev, &hub->dev))
> > + if (!usb_new_device(dev, &hub->dev)) {
> > + hub->children[port] = dev;
> > goto done;
> > + }
>
> I'm surprised you need it. The updated usbfs is supposed
> to be immune. This is probably the reason it wasn't ported.

Well the race occurs between usb_disconnect() initiated by rmmod
uhci-hcd and this function.
--
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/