Skip to content

Use the native Linux USB ABI and bound control transfers. - #86

Merged
jon merged 3 commits into
mainfrom
work/audit-linux-control
Oct 31, 2026
Merged

jon merged 3 commits into
mainfrom
work/audit-linux-control

Conversation

@jon

@jon jon commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Linux endpoint-zero control transfers now reject buffers above 65,535 bytes, retain pinned buffers through the ioctl, and derive the request size from the native control structure. Positive deadlines round up to milliseconds and clamp to the host timeout limit without overflow. Interface and bulk requests also use the host ioctl direction encoding, including PowerPC and MIPS.

The policy checker also updates its HTML parser to address GO-2026-6860. This raises the minimum Go version to 1.26.10.

Why

The fixed request encoded a 64-bit structure size on 32-bit hosts. Buffer lengths and long deadlines could also wrap before reaching usbfs. The request constant is now typed so the USB tests compile on 32-bit Linux. PowerPC and MIPS need different direction bits for interface and bulk requests as well; compile-time assertions check both encoding families against their expected command numbers.

Documentation

The Linux USB guide documents the buffer and timeout bounds and distinguishes ABI checks from physical architecture validation.

The README records the new minimum Go version.

jon added 2 commits October 4, 2026 21:53
The fixed ioctl request encoded a 64-bit structure on 32-bit hosts,
while buffer lengths and long deadlines could wrap before reaching
usbfs. Derive the request size from the native structure, reject
oversized buffers, and round and clamp the timeout without overflow.
Pin the data through the synchronous ioctl so its integer address
cannot outlive the backing storage.
PowerPC and MIPS encode ioctl directions differently from the generic
Linux ABI. Native structure sizes alone leave interface and bulk
requests using the wrong command numbers. Select the direction masks
for the host and retain compile-time checks against the expected USB
request numbers on both encoding families.
@jon

jon commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T20:12:04.233981Z 946a2a8 Manual request
🔒 Security Review ✅ Completed 2026-10-05T15:39:09.856327Z c71a497 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The HTML parser used on pull-request descriptions is affected by
GO-2026-6860. Upgrade x/net to the fixed release and require Go 1.26.10
so the checker also avoids the affected Go 1.26.0 URL parser. Record
the new minimum in the installation instructions.
@jon

jon commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@jon
jon force-pushed the work/audit-linux-control branch from c71a497 to 946a2a8 Compare October 31, 2026 20:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 946a2a8f6e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread go.mod Resolved
@jon

jon commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 946a2a8f6e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jon
jon merged commit e71342c into main Oct 31, 2026
9 checks passed
@jon
jon deleted the work/audit-linux-control branch October 31, 2026 20:15
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.

1 participant