fix(apple): admit only compatible dyld subcache mappings (#1090)

UUID, architecture, and cache VM offset are one admission decision, so a
matching UUID cannot publish contradictory mappings. A shared-cache trace
hit also requires the mapped bytes to parse as a Mach-O the process can load.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
morluto
2026-10-08 22:51:06 +08:00
committed by GitHub
co-authored by Cursor Agent
parent 03bbecd941
commit 4e98543e90
6 changed files with 186 additions and 16 deletions
+10 -2
View File
@@ -80,10 +80,18 @@ export interface DylibSharedCacheView {
/** Subcaches whose bytes are missing or do not match, such as `.03 (missing)`. */
readonly unavailableSubcaches: readonly string[];
/**
* `mapped`: listed and inside a verified mapping; `unverified`: listed, but
* the subcache holding it is unavailable; `absent`: not listed.
* `mapped`: listed and inside an admitted mapping. That is address coverage,
* not a load: a shared-cache hit also requires `image` to parse a slice this
* process can load. `unverified`: listed, but the subcache holding it is
* unavailable. `absent`: not listed.
*/
lookup(path: string): "mapped" | "unverified" | "absent";
/**
* Load commands at a mapped install path. Undefined when `lookup` is not
* `mapped`. Tracing uses this only to confirm the hit; cached load commands
* are not traversed.
*/
image(path: string): Promise<MachoImageFacts | undefined>;
}
const candidateSchema = z.strictObject({