Skip to content

recovery: contribute real-device protocol fixes and guarded boot retry - #48

Draft
seanabrahams wants to merge 3 commits into
standardagents:mainfrom
seanabrahams:recovery/issue-43-device-findings
Draft

seanabrahams wants to merge 3 commits into
standardagents:mainfrom
seanabrahams:recovery/issue-43-device-findings

Conversation

@seanabrahams

Copy link
Copy Markdown

Problem and resulting behavior

The native v0.1.12 recovery path stopped on a MacBookPro14,2 that already lacked usable EMBEDDEDOS data. This draft contributes the C/Rust changes used to complete both restores, final boot, EFI publication and sensor-matched import, plus regression tests and the redacted hardware report.

Related to #43 and the overlapping protocol observations in #46. This does not close #43 or promote recovery beyond experimental support. The successful hardware run used local trust additions and retry procedures described below, rather than the prescribed unchanged signed-package flow.

Changes to review

  • Correct directional USB mux magic and receive-sequence handling; admit complete outgoing restore messages atomically. A base64-expanded firmware reply can exceed the existing 16 MiB control limit, so only outgoing restore XML gets the bounded 32 MiB-minus-header budget.
  • Handle manifest-selected FUDData, including a valid empty response when the pinned identity has no FUD components.
  • Persist bounded immutable FDRMemoryCommit snapshots before ACK; select the final store only after successful restore status, requiring final provisioning/personalization agreement.
  • Route only the exact legacy gg.apple.com:80 request over host-verified HTTPS to port 443. Keep device TLS tunnels opaque; retry only eligible connection failures before forwarding device request bytes, never trust failures or interrupted streams.
  • Add payload-redacted stage diagnostics and narrowly scoped USB EPIPE handling for rsepfirmware, final ticket, and blind memboot. The first two stalls were observed; memboot tolerance has synthetic coverage only. Restore status and stable functional USB remain mandatory.
  • Add explicit attended --resume-boot for two completed, consistent protected restore phases. It performs no restore, reset or Apple request; it validates markers, stores, image/ticket pairing and device identity before the existing boot/publication/import gates. Existing EFI and already-verified boot still block retries.

The commits separate the hardware-tested source, additional storage acceptance tests, and documentation. The report in docs/recovery-macbookpro14-2-report.md records test dates, package versions, deviations and unresolved findings. docs/linux-recovery.md explains the new command and limits.

Validation

Fresh make quality passed on October 8 (exit 0): formatting, warning-denied workspace/all-feature Clippy, 1,000 Rust tests passed, dependency policy, C tests and ASan/UBSan runs, kernel-module builds against 7.2.5-4-omarchy, and packaging verification. Five Rust tests were explicitly ignored: four requiring an external pinned Apple package and one live-hardware preflight. This run used Rust/Cargo 1.98.1 and LLD 22.1.8 from signature-verified cached distro packages extracted into an isolated workspace, plus cargo-deny 0.20.2. No toolchain or module was installed. Documentation links, whitespace and privacy-pattern checks passed.

Historical owner-attended hardware evidence (September 23–24): patched final boot exited 0; enrollment, match/non-match, Touch Bar, warm/cold persistence and password fallback passed. A later hibernation-associated fingerprint failure recovered after normal reboot, after which simultaneous 640x480 preview, fingerprint verification, Touch Bar and ALS passed. 720p capture/decode succeeded but preview usability failed before and after reboot. These remain separate lifecycle/application issues relevant to #18 and #20.

Four storage cases previously passed on disposable FAT32 with a clean post-unmount check. That is not power-loss evidence. No live firmware recovery, reset, enrollment change or host reboot was performed while preparing this PR.

Explicit review limits

  • Trust distribution is unresolved. The successful session used independently checked Apple roots in a process-scoped mount namespace. Those wrappers and roots are not included; this PR neither adds global trust nor bypasses TLS verification. It is not a turnkey repair for stock trust failures.
  • Boot-only resume is a new policy boundary. Ticket parsing proves consistency/identity, not an offline signature verification; firmware authenticity remains enforced by the T1. Review this feature separately from narrow transport compatibility fixes and split it out if appropriate.
  • The owner installed the matched signed cohort additively without a full system update, used a DKMS metadata override, and later configured private xART access and optional desktop PAM integration. None of those machine customizations is included here; the report preserves them as qualifications.
  • The full command-level failure matrix, signed-package recovery acceptance, hibernation recovery and 720p usability remain open. Tests use synthetic payloads. No EFI, firmware, tickets, calibration/keybag material, raw device logs, machine identifiers or temporary privileged controllers are included.

Please review the shared protocol blockers against #46 first. The draft preserves the tested changes for inspection; it is not a request to merge the broader retry/trust behavior without review.

— GPT on behalf of @seanabrahams

This branch has not been deployed

No deployments
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.

Validate native T1Bridge online recovery

1 participant