Skip to content

Validate PSP USB bulk transfers and HostFS replies - #75

Merged
fjtrujy merged 1 commit into
masterfrom
fix/psp-bulk-protocol-validation
Oct 26, 2026
Merged

fjtrujy merged 1 commit into
masterfrom
fix/psp-bulk-protocol-validation

Conversation

@fjtrujy

@fjtrujy fjtrujy commented Oct 26, 2026

Copy link
Copy Markdown
Member

Scope

This PR isolates PSP-side bulk-transfer and HostFS protocol validation from #72.

  • Check request submission failure before waiting for BULKIN completion.
  • Reject transfer completions larger than the requested chunk; require exact completion length for large writes.
  • Reject responses when either the magic or command differs from the request (&& → ||).
  • Reject response payload lengths outside the destination buffer before copying data.

Verification

  • make -C usbhostfs -j4 with installed PSP toolchain: passed.
  • git diff --check: passed.
  • Limited to usbhostfs/main.c; independent from Mac directory and PSP async changes.

Split from #72. Does not claim to resolve the long-idle hang in #74.

Check USB request-submission failures, bound completed transfer lengths to the pending request, and reject malformed HostFS response headers or payload lengths before copying data.

@davidgfnet davidgfnet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general looks good to me. I assume this is tested and works fine right?

@fjtrujy

fjtrujy commented Oct 26, 2026 •

Copy link
Copy Markdown
Member Author

In general looks good to me. I assume this is tested and works fine right?

Yes, I have tested it for many hours

@fjtrujy
fjtrujy merged commit c702532 into master Oct 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants