Page MenuHomeFreeBSD

Fix devinfo to not truncate pnpinfo
ClosedPublic

Authored by imp on May 30 2018, 7:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 11 2024, 7:28 PM
Unknown Object (File)
Oct 11 2023, 11:54 PM
Unknown Object (File)
Jul 1 2023, 1:22 AM
Unknown Object (File)
May 8 2023, 10:56 PM
Unknown Object (File)
Jan 24 2023, 2:01 AM
Unknown Object (File)
Dec 31 2022, 1:38 PM
Unknown Object (File)
Nov 28 2022, 12:50 AM
Subscribers
None

Details

Reviewers
imp
Summary

Sanity check the return from the kernel.

We should be getting back as many bytes as we asked for, and we
don't handle shortages at all, so just reject anything that's
not right.

Make the data returned by devinfo harder to overflow.

Rather than using fixed-length strings, pack them into a string table
to return. Also expand the buffer from ~300 charaters to 3k. This should
be enough, even for USB.

This fixes a problem where USB pnp info is truncated on return to
userland.

Update to device enumeration protocol 2

The new protocol from the kernel encodes things as a string table,
extract it into fields. strdup the strings, and free them when we're
done.

Note the need for a new kernel / userland for devinfo to work

This fixes devmatch for usb with long pnp info

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16922
Build 16799: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.May 31 2018, 3:01 AM

This was committed as r334413-r334416 which were tagged with the wrong review number.