<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cherryusb.git/core/usbh_core.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/cherryusb.git/atom/core/usbh_core.c?h=master</id>
<link rel='self' href='http://cgit.235523.xyz/cherryusb.git/atom/core/usbh_core.c?h=master'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/'/>
<updated>2026-07-17T01:43:01Z</updated>
<entry>
<title>fix(usbh): bounds-check cur_ep before writing ep[] in parse_config_descriptor (#426)</title>
<updated>2026-07-17T01:43:01Z</updated>
<author>
<name>yi chen</name>
<email>87560781+94xhn@users.noreply.github.com</email>
</author>
<published>2026-07-17T01:43:01Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/commit/?id=5bfaf7e3fc542db6624fc51cceccbb1d92d8706c'/>
<id>urn:sha1:5bfaf7e3fc542db6624fc51cceccbb1d92d8706c</id>
<content type='text'>
* 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</content>
</entry>
<entry>
<title>fix(security): check desc len overflow</title>
<updated>2026-07-14T02:54:43Z</updated>
<author>
<name>sakumisu</name>
<email>1203593632@qq.com</email>
</author>
<published>2026-07-14T02:54:43Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/commit/?id=bce3346209445d8e8f9d60860c3e7ff6936d12b3'/>
<id>urn:sha1:bce3346209445d8e8f9d60860c3e7ff6936d12b3</id>
<content type='text'>
Signed-off-by: sakumisu &lt;1203593632@qq.com&gt;
</content>
</entry>
<entry>
<title>update(security): check null pointer and overflow</title>
<updated>2026-07-12T10:37:33Z</updated>
<author>
<name>sakumisu</name>
<email>1203593632@qq.com</email>
</author>
<published>2026-07-12T10:37:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/commit/?id=22b07a18fde0befcdb59d58de5ad62c6ab4ba88e'/>
<id>urn:sha1:22b07a18fde0befcdb59d58de5ad62c6ab4ba88e</id>
<content type='text'>
Signed-off-by: sakumisu &lt;1203593632@qq.com&gt;
</content>
</entry>
<entry>
<title>fix(security): remove hport mutex safely</title>
<updated>2026-04-21T13:41:27Z</updated>
<author>
<name>sakumisu</name>
<email>1203593632@qq.com</email>
</author>
<published>2026-04-21T13:41:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/commit/?id=9ce1b1cee3ad712bbc3d2019f0f49d69987ce2d7'/>
<id>urn:sha1:9ce1b1cee3ad712bbc3d2019f0f49d69987ce2d7</id>
<content type='text'>
Signed-off-by: sakumisu &lt;1203593632@qq.com&gt;
</content>
</entry>
<entry>
<title>fix(class/hub): remove bus mutex, replace with mq to exit thread</title>
<updated>2026-04-17T02:56:13Z</updated>
<author>
<name>sakumisu</name>
<email>1203593632@qq.com</email>
</author>
<published>2026-04-16T14:02:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/commit/?id=3bd79e23648ac522ebfe9b17768bce7ea359b4a5'/>
<id>urn:sha1:3bd79e23648ac522ebfe9b17768bce7ea359b4a5</id>
<content type='text'>
Signed-off-by: sakumisu &lt;1203593632@qq.com&gt;
</content>
</entry>
<entry>
<title>fix(core): adjust init&amp;deinit event callback position</title>
<updated>2026-04-03T10:45:51Z</updated>
<author>
<name>sakumisu</name>
<email>1203593632@qq.com</email>
</author>
<published>2026-04-03T10:45:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/commit/?id=3d97aeebdef5d8a8ec3907d3f4f44816d49cd76e'/>
<id>urn:sha1:3d97aeebdef5d8a8ec3907d3f4f44816d49cd76e</id>
<content type='text'>
Signed-off-by: sakumisu &lt;1203593632@qq.com&gt;
</content>
</entry>
<entry>
<title>fix(core/usbh_core): fix desc length parse</title>
<updated>2026-03-30T11:05:59Z</updated>
<author>
<name>sakumisu</name>
<email>1203593632@qq.com</email>
</author>
<published>2026-03-30T11:05:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/commit/?id=b53673c2dbfdb8860c3980fcc036f81c508f74d3'/>
<id>urn:sha1:b53673c2dbfdb8860c3980fcc036f81c508f74d3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>style: change \t to space</title>
<updated>2025-12-17T12:43:42Z</updated>
<author>
<name>sakumisu</name>
<email>1203593632@qq.com</email>
</author>
<published>2025-12-17T12:43:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/commit/?id=55ef0f63096e9937738154de4cbcd310fcbabf29'/>
<id>urn:sha1:55ef0f63096e9937738154de4cbcd310fcbabf29</id>
<content type='text'>
Signed-off-by: sakumisu &lt;1203593632@qq.com&gt;
</content>
</entry>
<entry>
<title>fix(core): fix warnings</title>
<updated>2025-12-03T05:38:49Z</updated>
<author>
<name>sakumisu</name>
<email>1203593632@qq.com</email>
</author>
<published>2025-12-01T12:31:03Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/commit/?id=670bde36718d5fd110dbc22237513120b0fb6407'/>
<id>urn:sha1:670bde36718d5fd110dbc22237513120b0fb6407</id>
<content type='text'>
Signed-off-by: sakumisu &lt;1203593632@qq.com&gt;
</content>
</entry>
<entry>
<title>feat(core/usbh_core): support custom config index</title>
<updated>2025-11-27T14:43:56Z</updated>
<author>
<name>sakumisu</name>
<email>1203593632@qq.com</email>
</author>
<published>2025-11-27T14:43:16Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/cherryusb.git/commit/?id=e10b44f64e33ed5817caaf3a0779a5b55050dd12'/>
<id>urn:sha1:e10b44f64e33ed5817caaf3a0779a5b55050dd12</id>
<content type='text'>
Signed-off-by: sakumisu &lt;1203593632@qq.com&gt;
</content>
</entry>
</feed>
