| Age | Commit message (Collapse) | Author |
|
parse_config_descriptor (#426)
* fix(usbh): check cur_ep against CONFIG_USBHOST_MAX_ENDPOINTS before writing ep[]
parse_config_descriptor() checks cur_ep_num (the interface descriptor's
self-declared bNumEndpoints) against CONFIG_USBHOST_MAX_ENDPOINTS when
the INTERFACE descriptor is parsed, but cur_ep (the actual write index,
incremented once per ENDPOINT sub-descriptor encountered in the byte
stream) is never bounds-checked in the USB_DESCRIPTOR_TYPE_ENDPOINT
case before the memcpy.
A non-conformant or malicious device can declare a small bNumEndpoints
while still emitting more ENDPOINT descriptors than declared in the
raw config descriptor byte stream, causing cur_ep to exceed
CONFIG_USBHOST_MAX_ENDPOINTS and the memcpy to write past the ep[]
array, past altsetting[], and potentially past the whole
usbh_configuration struct.
Add the same bounds check pattern already used for cur_iface and
cur_alt_setting two cases above, applied to cur_ep before the memcpy.
* Allow interfaces to use configured capacity
Endpoint counts are quantities, so a declaration equal to the endpoint array capacity is valid. The per-index guard still rejects descriptors that contain more endpoint records than the storage can hold.
Constraint: Preserve the new cur_ep index guard
Confidence: high
Scope-risk: narrow
Tested: Real parser matrix for declared/actual 3/3, 4/4, 5/5, and 3/5; MinGW and WSL GCC13 ASan+UBSan
Not-tested: Physical USB device enumeration
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
|
|
usb_ringbuffer and usb_mempool
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
* fix: fix warning for speed_table
* fix(port/dwc2/usb_hc_dwc2): add roothub.speed init
* feat(usbh_core): add event_callback
* fix(usbh_hub): fix event device reset port
* fix(usbh_hub): remove event init when init failed
* feat(usbh_core): add default dummy_event_callback
* fix(usbh_hub): emit reset event only on successful reset
* fix(usbh_core): emit interface start only on successful connect class driver
* feat(usbh_core): change event_callback to typedef
* feat(port): update port usbh init params
* doc: update usbh_initialize desc
* fix(usbh_core): check result from ret == 0 change to ret >= 0
---------
Signed-off-by: egahp <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
100hz then 2ms = 0ms, refs: #342
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
- fix current_desc_len += p[DESC_bLength] before p+= p[DESC_bLength]
- fix reset all eps when alt_setting=0
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|