| 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]>
|
|
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]>
|
|
��USBHS支持 (#422)
* 1、usb_hc.h中struct usbh_urb结构体添加defined(__CC_ARM)判断,MDK AC5编译器不支持struct usbh_iso_frame_packet iso_packet[0]只支持struct usbh_iso_frame_packet *iso_packet
2、usb_glue_nation.c中添加N32H49X和N32H7XX系列MCU的USBHS支持
* 回退对usb_hc.h的修改
|
|
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]>
|
|
multiply of mps
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
device->rx_indicate
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]>
|
|
NimBLE (nimble-1.6.0/ble_hci_usbh.c):
- fix hci_read_callback: pass full buffer to hci_h4_sm_rx in one call
instead of splitting type byte and payload into two calls
- fix ble_transport_to_ll_cmd_impl: use struct ble_hci_cmd for
type-safe length calculation instead of raw byte indexing
- fix ble_transport_to_ll_acl_impl: gather mbuf with os_mbuf_copydata
and issue single usbh_bluetooth_hci_write; the old per-segment loop
violated USB Bluetooth class bulk transfer requirements
- fix unused-parameter warnings in run/stop callbacks
Zephyr (zephyr_bluetooth-2.7.5/ble_hci_usbh.c):
- remove unreachable fallthrough comment after return statement
- restore ISO payload length check (was commented out); use inline
mask (& 0x3FFF) per BT Core Spec v5.x Vol 4 Part E Section 5.4.5
- fix bt_usbh_send error code: 255 -> -EIO
- guard bt_hci_driver_register with static bool to prevent duplicate
registration on USB reconnect
- fix unused-parameter warnings in run/stop callbacks
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: Zhihong Chen <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|