tech-kern archive

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

RE: Reboot resistant USB bug



Emmanuel Dreyfus wrote:
> I did not post the whole patch for the sake of clarity, but it seems it
was a
> mistake. Please find it below.
>
> The substituted values are chosen based on vendorId/producId obtained
earlier
> from the device descriptor (which fortunately does not get corrupted). If
one
> swaps the device, I understand the struct usbd_device on which we operate
is not
> the same anymore, and productId/vendorId are up to date. 

Apologies for misunderstanding. If you are able to get the device
descriptor, then this ought to work. 

In Windows, since they match only on vid/pid/rev, for a simple device, they
can put this fix in the device driver. That might also be an approach to
take in NetBSD. On multi-function devices, Windows will insist on reading
and examining the config descriptor in the multi-function "bus" driver, and
bad things will happen if data is not consistent. So this is most likely to
be a problem with relatively simple devices.

FWIW, this change increases the analysis surface for the USB stack, since a
reviewer has to understand the possible descriptor substitutions, and the
subsitutions are not with the rest of the code of the device.

Best regards,
--Terry



Home | Main Index | Thread Index | Old Index