| Summary: | [usb] usbd_probe_and_attach() is broken and may crash the system | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Bodo Rueskamp <br> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.3-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Bodo Rueskamp
2001-08-18 13:50:00 UTC
Responsible Changed From-To: freebsd-bugs->n_hibma Nick is Mr USB This indeed is a problem. The problem exposes another problem: Devices which have been attached while no matching driver is available are not probed properly. So, for example 2 functions on the first interface with a second interface after that one, will not be attached properly if the driver is loaded after the device has been physically attached. The probe routine is flawed in that it only works properly if the appropriate driver was loaded when the device was attached. USB devices uses several rounds of probes to decide which driver is the best to use. The solution is to put the probe_and_attach routine as a bus_probe and bus_attach DEVMETHOD in uhub, but that requires quite a bit of work. No ETA. Two things here: First, the same problem could occur if usbd_probe_and_attach() was called twice. The fix for this is to change uaa form auto to static. Secondly, since auto variables are stored on the stack and malloc() deals with the heap, my patch will have to be applied (to put uaa where malloc() can get to it) before the original fix. Lucas State Changed From-To: open->feedback Is this still a problem with modern versions of FreeBSD? Responsible Changed From-To: n_hibma->freebsd-bugs With permission of assignee, reset assignment. State Changed From-To: feedback->closed Submitter's email address bounces. |