Skip to content

ibss: take a protocol error as the boot ROM's new DFU session - #166

Merged
henrikklee merged 2 commits into
OrchardLinux:mainfrom
ashtonamory:a7-ibss-clrstatus-fault
Dec 5, 2026
Merged

henrikklee merged 2 commits into
OrchardLinux:mainfrom
ashtonamory:a7-ibss-clrstatus-fault

Conversation

@ashtonamory

Copy link
Copy Markdown
Contributor

ibss: take a protocol error as the boot ROM's new DFU session

After gaster's patch, the boot ROM drops off USB and comes back with a new DFU session. On an iPhone 5s (N51) attached to a Linux host, the transfer in flight ends with EPROTO (nusb TransferError::Fault, which maps to Kind::Other) rather than a disconnect. So fresh_dfu_after_gaster failed every ibss start right after the exploit had worked.

This change accepts that error as the drop too. wait_marked still requires the boot ROM to come back with gaster's mark, so a real fault is still caught.

Testing

  • N51: orchard install omarchy-a --boot ibss and orchard run --boot ibss, over several starts. Without the change, every start fails at this step.
  • cargo test -p orchard-runtime passes.

ashtonamory and others added 2 commits December 5, 2026 08:02
After gaster's patch the boot ROM leaves USB and comes back with a new
DFU session. On an iPhone 5s (N51) attached to a Linux host the transfer
in flight ends with EPROTO (nusb TransferError::Fault, Kind::Other), not
a disconnect, so every ibss start failed right after the exploit had
worked. Accept that error too; wait_marked still requires the boot ROM
back with gaster's mark, so a real fault is still caught.

Tested: N51, orchard install omarchy-a --boot ibss and orchard run,
several starts.

Assisted-by: LLM
Since OrchardLinux#170 a transfer that breaks off on the bus (Linux EPROTO, what
the iPhone 5s shows here) has its own kind, Kind::Fault. Take that and a
disconnect as the boot ROM leaving for its new session, rather than
every error without a kind of its own (Kind::Other).

Assisted-by: LLM
@henrikklee
henrikklee force-pushed the a7-ibss-clrstatus-fault branch from f591cc5 to ff48faf Compare December 5, 2026 00:02
@henrikklee
henrikklee merged commit 2438241 into OrchardLinux:main Dec 5, 2026
11 checks passed
@henrikklee

Copy link
Copy Markdown
Contributor

Merged, thank you @ashtonamory! You found that on Linux the iPhone 5s's boot ROM leaving for its new DFU session after gaster shows up as a USB protocol error rather than a disconnect, and that every ibss start failed right after the exploit had worked. Tested over several installs and RAM starts on the N51, too. Great catch.

What changed on the branch:

Follow-ups: it ships with today's tools release. If a 5s start on Linux still stops at this step with the release, please post the log here and I'll take it from there.

@henrikklee henrikklee mentioned this pull request Dec 5, 2026
henrikklee pushed a commit to theChristopher16/tools that referenced this pull request Dec 5, 2026
After gaster, the hand-over to the iBSS clears the DFU status and resets
USB. On an iPad mini 2 (J85) on an Intel Mac, the clear went unanswered
with IOKit's kIOReturnNotResponding (0xe00002ed), which reaches Orchard
as Kind::Other, and the run stopped there, although the device had taken
the request and sat idle in DFU.

On such an error, which is neither a disconnect nor a fault (those keep
their handling), open the device again once, still requiring gaster's
mark, and read its status once. Go on if it reads OK and dfuIDLE;
otherwise fail with the original error. The normal hand-over (clear,
then USB reset) is unchanged for every device; no new loop, and the
reopen uses the existing reconnect deadline.

Assisted-by: LLM
[Orchard: rebased onto main after OrchardLinux#166; narrowed: dropped the status read
 before every clear, which skipped the clear and the USB reset whenever
 the device read idle, for every device; kept only the check after an
 unanswered clear; replaced the tests with ones for that decision; added
 the changelog line and the commit message.]
henrikklee pushed a commit to theChristopher16/tools that referenced this pull request Dec 5, 2026
After gaster, the hand-over to the iBSS clears the DFU status and resets
USB. On an iPad mini 2 (J85) on an Intel Mac, the clear went unanswered
with IOKit's kIOReturnNotResponding (0xe00002ed), which reaches Orchard
as Kind::Other, and the run stopped there, although the device had taken
the request and sat idle in DFU.

On such an error, which is neither a disconnect nor a fault (those keep
their handling), open the device again once, still requiring gaster's
mark, and read its status once. Go on if it reads OK and dfuIDLE;
otherwise fail with the original error. The normal hand-over (clear,
then USB reset) is unchanged for every device; no new loop, and the
reopen uses the existing reconnect deadline.

Assisted-by: LLM
[Orchard: rebased onto main after OrchardLinux#166; narrowed: dropped the status read
 before every clear, which skipped the clear and the USB reset whenever
 the device read idle, for every device; kept only the check after an
 unanswered clear; replaced the tests with ones for that decision; added
 the changelog line and the commit message.]
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