Skip to content

Trusted darwinOS & Cryptexes: Full Version Support - #932

Merged
0xJacky merged 12 commits into
Lakr233:mainfrom
mpass99:fix/cryptex-persist-ios18
Nov 15, 2026
Merged

0xJacky merged 12 commits into
Lakr233:mainfrom
mpass99:fix/cryptex-persist-ios18

Conversation

@mpass99

@mpass99 mpass99 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Based on feature/kc-recipe-27.2 #931. Only the last two commits belong to this PR; the other ten come from those branches.

Related to #900

Changes

1. Keep cryptexes on iOS 18 (Keep cryptexes on iOS 18, whose cryptexctl prints no identifier)

cryptex.install with persist: true took the cryptex identifier from the first line of cryptexctl install --print-info. cryptexctl 26.5 prints the identifier there, but cryptexctl 18.6 prints no identifier. So on iOS 18 the cryptex was installed but not kept ("installed, but not kept: cryptexctl named no identifier"), and it was gone after a reboot. vphoned now reads the identifier from the .cxbd itself: CFBundleIdentifier in Restore/Cryptex/<identifier>/ginf. It falls back to the cryptexctl output.

2. Allow trusted darwinOS on iOS 27 (Allow trusted darwinOS on iOS 27, whose own cloudOS boots it)

This reverts trustedDarwinOSRefusal (f1c0268). The refusal was based on iOS 27.0.1 with cloudOS 26.4. That pairing runs cloudOS 26.4's TXM (187.100.3) under iOS 27 binaries, which TXM rejects (txm_selector24_cms_gate.md). Only standard's TXM patches make that pairing boot, and minimal leaves TXM stock. So the panic tells us about the pairing, not about iOS 27 in trusted darwinOS. iOS 27.2 with cloudOS 27.2 boots in environment 6 and runs cryptexes.

  • Manual (machines/cryptexes.md, en/ja/ko/zh): says to pair iOS with the cloudOS of the same release, and lists the versions checked.
  • Research note (trusted_darwinos_cryptexes.md): keeps the 27.0.1 panic log with the explanation above, and adds the table below.
  • 0_binary_patch_comparison.md: the entry is rewritten to match.

Testing

Each pairing below was a new machine (vm create --preset minimal --allow filesystem-exp-trusted_darwinos --no-template). Each went through the same steps:

  1. The restore requested Ap,OSEnvironment = 6, and the first boot reported libignition trusted-darwinos.
  2. Two cryptexes installed with persist: true: a shell script, read back, and a launch daemon answering on TCP 7070.
  3. After system.reboot, both were mounted again as soon as vphoned answered, and the daemon ran with a new pid.
  4. After cryptex.uninstall of both, nothing was listed or kept.

No machine logged a panic.

iPhone cloudOS
iPhone11,6 18.1 (22B83) ¹ 18.1 (22B83)
iPhone11,6 18.2.1 (22C161) ¹ 18.2.1 (22C161)
iPhone11,6 18.3.1 (22D72) 18.3.1 (22D72)
iPhone11,6 18.5 (22F76) 18.5 (22F76)
iPhone11,6 18.6 (22G86) 18.6 (22G86)
iPhone11,6 18.7 (22H20) 18.7 (22H20)
iPhone11,6 18.7.2 (22H124) 18.7.2 (22H43)
iPhone17,3 26.1 (23B85) 26.1 (23B85)
iPhone17,3 26.3 (23D127) 26.3 (23D129)
iPhone17,3 26.4 (23E246) 26.4 (23E244)
iPhone17,3 26.5 (23F77) 26.5 (23F75)
iPhone17,3 26.6 (23G71) 26.6 (23G71)
iPhone17,3 27.2 (24B119) 27.2 (24B115)

¹ These first boots logged no kernel output, so no libignition line. The restore requested environment 6, and cryptexd accepted the cryptexes.

  • Bundles: 18.6, 26.5 and 27.2 ran on a bundle built from this branch. The rest ran on 2.17.1 with the persist fix, with or without feature/portable-kmutil. iOS 18.6 failed to keep its cryptexes without the persist fix, and kept them with it.
  • Unit tests: FirmwarePatcherTests has no failures related to this change. The ones that fail need local IPSW fixtures.
  • Not tested: cross-release pairings, such as iOS 26.6.2 on cloudOS 26.4 or iOS 18.6.2 on cloudOS 26.1.

mpass99 and others added 12 commits November 13, 2026 17:40
DyldSharedCache reads an arm64e cache and its subcaches (slide info v5),
and DyldCacheDylibExtractor rebuilds one image as a loadable MH_DYLIB:
segments keep their address modulo 4 KiB, slide pointers become chained
fixups with their PAC schema, calls into other images or stub islands go
through new auth stubs, coalesced GOT accesses through new GOT slots, the
unwind personality gets a slot of its own, and __LINKEDIT is rebuilt.

It is what lets the kmutil of another macOS run here with that release's
libKernelCollectionBuilder.dylib (DYLD_LIBRARY_PATH), which only exists
inside the shared cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iOS 27 kexts call the kernel's strcmp, which lives in __bootcode
(__TEXT_BOOT_EXEC), through their auth stubs. KernelCollectionStubCalls
only took targets in __TEXT_EXEC and refused the 27.2 mix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A kernel boots only in the layout its builder gave it, and every
kernelcache names that builder (_PrelinkKCID, KernelManagement_host-X).
KernelCollectionToolchain takes this Mac's kmutil when it is that version,
else the kmutil of the macOS release that ships it, read once out of that
IPSW's recoveryOS with range requests, with libKernelCollectionBuilder
lifted out of its shared cache. Releases are checked against the bases:
463.40.2 (macOS 15.1, iOS 18.1-18.3.1), 463.100.7 (15.6.1, 18.5-18.7.2),
487.100.11 (26.5, 26.4-26.7, watch, HomePod), 514.40.8 (27.2.1, 27.2).

libvphone-kmutil-shim.dylib, built into the bundle, shows kmutil the
user's files as root's and gives it its own release's KernelManagement
configuration (macOS 15's kmutil traps on the 26+ one), so `fw kernelcache`
stages and links without sudo on any macOS. Root only reads a mix from the
cache and never runs the toolchain. The ssh builder (VPHONE_KMUTIL_SSH)
and the root link are gone, and the catalog reports no kernel-first device.

`fw kernelcache --kernelcache <file>` mixes a kernelcache without a VM.
The mix revision is 7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core Bundles from this change link every kernelcache mix themselves, with
the kmutil the base names, and no longer report kernel-first devices, so
New Machine's macOS builder fields, `vm create --kmutil-ssh` and the
password forwarding of vphone-launchpad-cli go. The helper link after
"[+] Staged." stays for 2.17 bundles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From iOS 27 on, restored takes its "fast mtree path": it skips mtree -m
and writes MODIFICATION from the root entry's time, cut to whole
seconds, whatever was edited after it. Every 26.x restore logged "Fast
mtree path not enabled", 27.2's "enabled", and the host sends no option
for it. Seal with that time from iOS 27 on, or apfs_sealvolume's digests
do not match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cloudOS 27's app entries gained a field before the name, so the part
offsets lie 0x80 bytes before it instead of 0x78. Try both distances and
take the one whose first part starts with a Mach-O header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iBoot loads its link address with ldr x1, =base, its third instruction.
The literal sat at 0x300 up to iOS 26; iOS 27 moved it to 0x380 and put
the version string at 0x300, so the OpenAVB identity refused the 27.2
iBSS. Follow the LDR, keeping 0x300 as the fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… data

The descriptor transport has a fifth operation, SET_HAS_DATA, the twin of
the MMIO path's HAS_DATA bit. AVPBooter sends it after every write;
OpenAVB did not, so a written request read back as empty. iBoot up to
iOS 26 read the request without asking. The iOS 27 LLB asks HAS_DATA
first and panicked ("iBoot Panic: 368a9bee26e56b8:73"). With the patch it
logs the same lines as under AVPBooter and the kernel boots.

The image is rebuilt by UpdateOpenAVB.sh from the pinned commit plus
patches/0001-entropy-descriptor-set-has-data.patch, which also updates
OpenAVB's transport test model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The macOS 27 kmutil writes x16, the start of the kernel's __TEXT_EXEC,
into an iOS 27 collection's LC_UNIXTHREAD. A standalone kernel has none,
and kmutil refuses one that keeps the collection's address ("LC_UNIXTHREAD
entry is out of range"): clear it along with remapping pc.

Also test that an auth stub into __TEXT_BOOT_EXEC becomes a direct branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A research board kernelcache for iOS 27.2 (24B119): cloudOS 27.2 seed
24B115's kernel (24B112) with the vphone600 26.4 (23E5207q) donor kexts,
linked by the macOS 27.2.1 kmutil. Every donor import resolves; the
metaclass and vtable imports were checked against the base's
OSMetaClass constructors.

The catalog offers cloudOS 27.2 as a research board cloudOS and pairs
iOS 27.2. HomePod keeps cloudOS 26.4 for releases without a HomePod
recipe, now that 27.2 has a research board cloudOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cryptexctl 18.6's install --print-info prints nothing, so persist failed
with "installed, but not kept: cryptexctl named no identifier" and the
cryptex was gone after a reboot. Take the identifier from the .cxbd
itself (CFBundleIdentifier in Restore/Cryptex/<id>/ginf) and fall back
to the first line of --print-info.

Checked on iOS 18.6 / cloudOS 18.6: two cryptexes kept, back after a
reboot, uninstalled, no panic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The iOS 27 refusal came from iOS 27.0.1 on cloudOS 26.4, a pairing that
boots cloudOS 26.4's TXM under iOS 27 binaries: only standard's TXM patches
make it boot, and minimal leaves TXM stock. iOS 27.2 with cloudOS 27.2
restores in environment 6, boots, and installs, keeps across a reboot and
uninstalls cryptexes. The manual now asks for iOS and cloudOS of the same
release, and the research note lists the 13 pairings checked on 2026-11-13
and 14, from iOS 18.1 to 27.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0xJacky
0xJacky merged commit a678496 into Lakr233:main Nov 15, 2026
3 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