Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Aug 2019 22:14:52 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        Ian Lepore <ian@freebsd.org>, Neeraj Pal <neerajpal09@gmail.com>, freebsd-arch@freebsd.org
Subject:   Re: Regarding the bug in FreeBSD kernel driver(s)
Message-ID:  <52d24915-d295-806d-55c6-f801ef340c7f@selasky.org>
In-Reply-To: <cb4108b6e8494259e31d1ab7d5163ae77a2a2116.camel@freebsd.org>
References:  <CANi4_RUcNt8Z0Gw1DqoOCAYt61kfhv2aoz1v9snrB_Jg38z_zQ@mail.gmail.com> <cb4108b6e8494259e31d1ab7d5163ae77a2a2116.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2019-08-13 22:08, Ian Lepore wrote:
> So once a device is attached the first time, its usb ivars are wiped
> out.  That code was surely written in a time before the devctl stuff
> was added to allow disabling/enabling a device on the fly.  I'm not
> sure whether it will be easy to keep the ivar data around, but if so, I
> think that would be the right fix.
> 
> The NULL pointer checks in the patches will prevent a kernel panic, but
> don't really make devctl enable work properly.  Speaking of devctl, you
> don't need a program to test this, you can do it from the command line:
> 
>     devctl disable uhub2
>     devctl enable uhub2
>     <panic happens here>

Hi,

USB drivers are not supposed to be managed outside the USB enumeration 
thread. Using devctl on USB driver is not supported. Only usbconfig is 
allowed to attach/detach USB devices.

Should we perhaps teach devctl to not touch USB devices?

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52d24915-d295-806d-55c6-f801ef340c7f>