Commit 6af73c4
committed
Pull up following revision(s) (requested by riastradh in ticket #1175):
sys/dev/usb/xhci.c: revision 1.191
sys/dev/usb/usb_subr.c: revision 1.280
sys/dev/usb/usb_subr.c: revision 1.281
sys/dev/usb/usbdivar.h: revision 1.140
usb(9): Record config index, not just number, in struct usbd_device.
The index is a zero-based index in [0, bNumConfigurations), or -1 for
unconfigured.
The number is an arbitrary value of a config descriptor's
bConfigurationValue field, or 0 for unconfigured -- with the tricky
caveat that bConfigurationValue might also be 0.
Preparation for fixing:
PR kern/59185: panic over KASSERTMSG(dev->ud_ifaces == NULL) on Dell
Latitude 7490
PR kern/59624: Booting NetBSD-11 from USB on my Dell machine panics
and hangs
PR kern/57447: HEAD fails to probe USB devices and fails to boot up
usb(9): Use ud_configidx, not ud_config, to see if unconfigured.
ud_config is a device-provided quantity in the config descriptor's
bConfigurationValue, and a faulty (or malicious) device can provide 0
for that value, which coincides with our software sentinel value
USBD_UNCONFIG_NO of 0.
Instead of testing ud_config, test ud_configidx, which is an index in
[0, bNumConfigurations) or -1, for which the device cannot confuse us
by a value that coincides with the sentinel -1.
PR kern/59185: panic over KASSERTMSG(dev->ud_ifaces == NULL) on Dell
Latitude 7490
PR kern/59624: Booting NetBSD-11 from USB on my Dell machine panics
and hangs
PR kern/57447: HEAD fails to probe USB devices and fails to boot up1 parent 22d701b commit 6af73c4
3 files changed
+36
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
| |||
691 | 690 | | |
692 | 691 | | |
693 | 692 | | |
694 | | - | |
695 | | - | |
| 693 | + | |
696 | 694 | | |
697 | 695 | | |
698 | 696 | | |
699 | 697 | | |
700 | 698 | | |
701 | 699 | | |
702 | 700 | | |
703 | | - | |
| 701 | + | |
704 | 702 | | |
705 | 703 | | |
706 | 704 | | |
| |||
719 | 717 | | |
720 | 718 | | |
721 | 719 | | |
| 720 | + | |
722 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
723 | 726 | | |
724 | 727 | | |
725 | 728 | | |
| |||
880 | 883 | | |
881 | 884 | | |
882 | 885 | | |
| 886 | + | |
883 | 887 | | |
884 | 888 | | |
885 | 889 | | |
| |||
903 | 907 | | |
904 | 908 | | |
905 | 909 | | |
906 | | - | |
907 | 910 | | |
| 911 | + | |
908 | 912 | | |
909 | 913 | | |
910 | 914 | | |
| |||
1174 | 1178 | | |
1175 | 1179 | | |
1176 | 1180 | | |
1177 | | - | |
1178 | 1181 | | |
1179 | 1182 | | |
1180 | 1183 | | |
| |||
1426 | 1429 | | |
1427 | 1430 | | |
1428 | 1431 | | |
| 1432 | + | |
| 1433 | + | |
1429 | 1434 | | |
1430 | 1435 | | |
1431 | 1436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
231 | 249 | | |
232 | 250 | | |
233 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
2828 | 2828 | | |
2829 | 2829 | | |
2830 | 2830 | | |
| 2831 | + | |
| 2832 | + | |
2831 | 2833 | | |
2832 | 2834 | | |
2833 | 2835 | | |
| |||
0 commit comments