fix(apple): gate shared-cache answers on platform and verified subcaches
- Use a supplied cache for a process only when it serves the process's CPU family and one of its LC_BUILD_VERSION or LC_VERSION_MIN platforms matches the cache's platform or alternate platform; slices now report platforms. A limitation names each root the cache was not used for, and why. - Treat an image listed in the cache but mapped in a missing or UUID-mismatched subcache as undetermined, list it in coverage.unverified_shared_cache_images, and mark coverage partial. - Keep a cache hit conditional when an earlier candidate is undeterminable. - Open a development cache's named subcaches beside its base name. - Describe absolute paths as not evaluated only when no cache is supplied. - Preflight dyld_info in verify:dyld-shared-cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
202661f83b
commit
305474df6c
@@ -154,13 +154,13 @@ parser coverage, such as big-endian images), `architecture-missing`,
|
||||
`outside-target`, `shared-cache`, `escapes-target`, or `undetermined`. Slices follow dyld's
|
||||
graded architectures, so an `x86_64h` process also loads `x86_64`. The edge's `resolution` is one of:
|
||||
|
||||
| Status | Meaning |
|
||||
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `resolved` | An image inside the analyzed root loads, and no earlier candidate was undeterminable. |
|
||||
| `conditional` | An image inside the root resolves, but an earlier candidate outside the root (for example `/usr/lib/swift`) would win if it exists on the running system. |
|
||||
| `unresolved` | Every candidate is definitively absent or unusable inside the root. |
|
||||
| `undetermined` | No candidate resolves inside the root, and some candidate lies outside it or depends on the environment. |
|
||||
| `shared-cache` | An absolute install path, or an `@rpath` candidate outside the root, was found in the dyld shared cache passed as `shared_cache` (CLI `--shared-cache`). dyld loads the cached image, so later in-root candidates are unused. |
|
||||
| Status | Meaning |
|
||||
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `resolved` | An image inside the analyzed root loads, and no earlier candidate was undeterminable. |
|
||||
| `conditional` | An image inside the root, or in the supplied shared cache, resolves, but an earlier candidate that REA cannot decide (for example `/opt/vendor/lib` or `/usr/lib/swift` without a cache) would win if it exists on the running system. |
|
||||
| `unresolved` | Every candidate is definitively absent or unusable inside the root. |
|
||||
| `undetermined` | No candidate resolves inside the root, and some candidate lies outside it or depends on the environment. |
|
||||
| `shared-cache` | An absolute install path, or an `@rpath` candidate outside the root, was found in the dyld shared cache passed as `shared_cache` (CLI `--shared-cache`). dyld loads the cached image, so later in-root candidates are unused. |
|
||||
|
||||
Absolute install names such as `/usr/lib/libSystem.B.dylib` are
|
||||
`outside-target`. On macOS 11 and later most of them live in the dyld shared
|
||||
@@ -180,11 +180,22 @@ cache rather than on disk, so REA does not check them against the host.
|
||||
image. It also compares the predicted load order of two process roots with the
|
||||
images dyld actually loads (`DYLD_PRINT_LIBRARIES`).
|
||||
|
||||
With `shared_cache`, absolute candidates are looked up in that cache's image list.
|
||||
This only happens when the cache serves the process's CPU family: an arm64e
|
||||
cache serves arm64 and arm64e processes. The result's `shared_cache` names the
|
||||
cache path, UUID, architecture and OS version. Cached images are not traversed.
|
||||
Without a cache, system paths stay `undetermined`.
|
||||
With `shared_cache`, absolute candidates are looked up in that cache's image
|
||||
list. A process uses the cache only when both of these hold:
|
||||
|
||||
- the cache serves its CPU family (an arm64e cache serves arm64 and arm64e);
|
||||
- one of its `LC_BUILD_VERSION` or `LC_VERSION_MIN_*` platforms (reported per
|
||||
slice as `platforms`) matches the cache's platform or alternate platform.
|
||||
|
||||
An iOS cache extracted from an IPSW is therefore not used for a macOS
|
||||
executable. A limitation names each process root the cache was not used for,
|
||||
and why. The result's `shared_cache` names the cache path, UUID, architecture
|
||||
and OS version. Cached images are not traversed.
|
||||
|
||||
An image listed in the cache but mapped in a missing or UUID-mismatched
|
||||
subcache is `undetermined`. It is listed in
|
||||
`coverage.unverified_shared_cache_images` and makes coverage partial. Without a
|
||||
cache, system paths stay `undetermined`.
|
||||
|
||||
## dyld shared cache
|
||||
|
||||
|
||||
Reference in New Issue
Block a user