audit 0.21.0: DFU, video and net follow-ups (DFU UPLOAD during dfuDNBUSY)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 10/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- c, embedded-iot
- Domain
- embedded-iot, networking
Research direction
This is a batch audit write-up, not a single task: split it before anyone starts. For item 2, begin at the UPLOAD callback around src/class/dfu/dfu_device.c:273 and the DFU 1.1 state table (which states accept UPLOAD, what follows a short upload, the required STALL/status for UPLOAD during dfuDNBUSY) — done means a state gate plus a test where an async download holds the buffer while UPLOAD arrives. Items 1 and 3 sit in src/class/net/ecm_rndis_device.c and src/class/video/video_device.c:868,1441 and need CDC/UVC spec review and hardware-in-the-loop runs, so treat the listed verdicts as candidates, not cleared instructions.
Written by the indexing model from the issue text.
Description
Deferred defects found in the repository audit of 0.21.0..ad7c83db8 (batch class-other). Each was validated against the source at ad7c83db8 and judged real but too large, or too hardware-dependent, for the audit PR's contained fixes.
1. Busy notification endpoint loses an ECM link transition.
- Where:
src/class/net/ecm_rndis_device.c:89,407 - Verdict: valid. Setter updates local state,
netd_report()returns on failed claim, and notification completion performs no retry.; introduced: Older; these paths are unchanged by the range.; severity: medium - Hardware/spec dependence: Loss is software-provable; notification policy needs CDC review before implementation. No record.
- Overlap: #4474 concerns NCM, not ECM; no full match found.
- Remaining work and verification: Preserve/coalesce desired ECM state and retry from task/completion context. Do not copy NCM’s fallible enqueue unchanged. Test a transition during an outstanding notification, then ECM hardware traffic.
2. UPLOAD can overwrite an outstanding asynchronous download buffer.
- Where:
src/class/dfu/dfu_device.c:273 - Verdict: valid source path. No state gate precedes the upload callback. Not introduced by the dedicated-buffer change: both operations previously used the same
get_xfer_buffer()too.; introduced: Older.; severity: high - Hardware/spec dependence: Corruption path is software-provable; required DFU state/error transitions need a record.
- Overlap: No matching coverage found; #4140/PR #4420 concern runtime DETACH.
- Remaining work and verification: Gate UPLOAD and audit its state transitions; test an asynchronous download retaining the buffer while UPLOAD arrives. Choose error handling only after DFU lookup.
3. SET_INTERFACE/reset mutate state outside the submission mutex.
- Where:
src/class/video/video_device.c:868,1441 - Verdict: valid race. The close/clear/reconfigure path can interleave with application submission; locking only
_clear_frame()would be insufficient.; introduced: Older race; new mutex only partially addresses concurrent ownership.; severity: medium - Hardware/spec dependence: Race requires no spec premise; safe endpoint retirement needs DCD semantics. No record.
- Overlap: #4428 overlaps stream teardown, but does not fully cover the RTOS submission race.
- Remaining work and verification: Serialize the whole lifecycle transition, including endpoint operations and reset. Add controlled interleaving tests and RTOS streaming/reset HIL.
Adjudication notes: class-other
Claims still needing read-doc:
- X1: CDC-NCM 1.0 §3.3.4/Table 6-3 and applicable errata: does the divisor/remainder constrain the Ethernet header or the payload after it? Does IN remainder 2 correctly describe every transmitted datagram?
- C2: DFU 1.1: which states accept UPLOAD, what transitions follow full/short uploads, and what STALL/state/status response is required for UPLOAD during DNBUSY?
- C3/S6: UVC: must COMMIT contain resolved format/frame/interval values, what minimum payload permits a valid stream, and how must invalid values be rejected? PROBE and GET_RES must be considered separately.
- S8: USB control OUT and RNDIS: required handling when
wLengthexceeds supported command storage, including permitted SETUP rejection and early data termination. - S7: CDC-ECM: required notification ordering/coalescing after a link change while a notification is outstanding.
- If C4/C6 fixes or S9/C5 proposals are pursued: verify endpoint close/reset/halt retirement and stale-completion behavior for each chosen DCD; for C5, ChipIdea dTD transaction/buffer errors and applicable MCU errata, plus UVC error recovery. No blanket all-DCD claim is established.
No additional introduced defect was confirmed beyond these findings. The RTOS self-deadlock strengthens C7/X2 and is already explicitly tracked by #4474.
Read-doc lookups, builds, unit tests, fuzzing and HIL did not run. Consequently the gated fixes are candidates, not cleared implementation instructions. GitHub checks returned 190 open follow-up issues and 28 open PRs; targeted issue searches supplemented them. No files were edited.
- Dominant language
- C
- Stars
- 7.3k
- Forks
- 1.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 67
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hathach/tinyusb
-
follow-up Port WCH USBFS Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
follow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
hil-contract: a background hil_remote.py launch is killed at the Bash default 10 min timeoutPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
ch32v30x: debug UART loses queued bytes when its TX ring fillsPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
followup Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
rofl0r/proxychains-ng#631 ·
-
RP2350: enabling secure boot via rescue fails with 6400 (BOOTKEY written as 33 bytes in ECC mode)Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
pcqpcq/open-source-android-apps#619 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
-
Missing slice offset check in jvp_equal fast path corrupts slice comparison and aborts delpathsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days