Commit 47d4aac
committed
Pull up following revision(s) (requested by riastradh in ticket #58):
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 62e44e4 commit 47d4aac
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 | | |
| |||
882 | 885 | | |
883 | 886 | | |
884 | 887 | | |
| 888 | + | |
885 | 889 | | |
886 | 890 | | |
887 | 891 | | |
| |||
905 | 909 | | |
906 | 910 | | |
907 | 911 | | |
908 | | - | |
909 | 912 | | |
| 913 | + | |
910 | 914 | | |
911 | 915 | | |
912 | 916 | | |
| |||
1194 | 1198 | | |
1195 | 1199 | | |
1196 | 1200 | | |
1197 | | - | |
1198 | 1201 | | |
1199 | 1202 | | |
1200 | 1203 | | |
| |||
1446 | 1449 | | |
1447 | 1450 | | |
1448 | 1451 | | |
| 1452 | + | |
| 1453 | + | |
1449 | 1454 | | |
1450 | 1455 | | |
1451 | 1456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
233 | 251 | | |
234 | 252 | | |
235 | 253 | | |
| |||
| 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 | | |
| |||
2860 | 2860 | | |
2861 | 2861 | | |
2862 | 2862 | | |
| 2863 | + | |
| 2864 | + | |
2863 | 2865 | | |
2864 | 2866 | | |
2865 | 2867 | | |
| |||
0 commit comments