Skip to content

Bound Objective-C metadata table and loaded-image reads - #89

Merged
lynnswap merged 12 commits into
mainfrom
codex/issue-83-bounded-objc-metadata-reads
Aug 26, 2026
Merged

Bound Objective-C metadata table and loaded-image reads#89
lynnswap merged 12 commits into
mainfrom
codex/issue-83-bounded-objc-metadata-reads

Conversation

@lynnswap

Copy link
Copy Markdown
Owner

Purpose

Objective-C table counts, byte ranges, loaded root pointers, and referenced layouts are external metadata. Several MachOObjCSection paths still performed unchecked arithmetic, trapping file reads, or unproved loaded-image dereferences. This change makes those structural failures recoverable and keeps readable sibling metadata without claiming they caused the previously observed iOS 27 failures.

Changes

  • Pin MachOObjCSection to 41a1652d95c34bbb2fdf32ba4b7f5cd9d3ba20ba, which centralizes bounded file/image table reads, checks method-entry arithmetic and method-section iteration, and adds checked loaded root and relationship readers.
  • Preserve existing value APIs while adding ordered ObjCMetadataTableDiagnostic results for regular member tables, loaded roots, and loaded relationships across class, protocol, and category reads.
  • Read loaded Objective-C roots through the checked aggregate and route both root and subject diagnostics through the existing bounded member diagnostic channel. The wire schema, cap, deduplication, omission accounting, persistence, and database schema remain unchanged.
  • Pin MachOSwiftSection to the coherent dependency cohort at 3344bd04e6c0819b17df126bea57bae1bbed3022 and update the exact-pin contract test.
  • Document the structural safety boundary explicitly. Referenced C strings, loaded class RW-extension arrays, and file-backed root sections remain outside this change.

Review focus

Testing

  • MachOObjCSection: 119 focused Phase A/B/C plus iOS and watchOS 27 drop canonicalized Objective-C protocol conformances #60/Resolve all loaded entries in Objective-C relative method and property lists #65/Objective-C metadata reads can still terminate iOS 27 helpers with FileIO.offsetOutOfBounds #79 tests passed; Debug and Release builds passed; iOS arm64 and watchOS arm64/arm64_32 cross-builds passed; Diagnostics SPI compile passed; independent audit and codex-review reported no findings.
  • MachOSwiftSection: Debug build, Release MachOSwiftSection product build, and 6 ObjC-ancestor tests passed after rebuilding the repository-required fixture; codex-review reported no findings.
  • PrivateHeaderKit: full swift test, Release build, iOS/watchOS Core and test compile checks, both simulator-helper Release builds, release-script tests, and exact dependency-pin tests passed.
  • iOS 27.0 beta 24A5390f: Foundation completed with 859 generated files, no Objective-C metadata warnings, and an ok database integrity check. AXSpringBoardServerInstance completed the new metadata collection and then reproduced its known post-collection SpringBoardUI +load abort in runtime fallback; the failure capsule and Crash Reporter agreed on PID, LC_UUID, and SIGABRT.
  • Final PrivateHeaderKit branch-wide codex-review against main: no findings (B4EC3F19-7ED9-4C85-BCE1-56A8B301C6A0).

Closes #83

@lynnswap

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: e42fd1c982

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lynnswap
lynnswap merged commit 3d31a8b into main Aug 26, 2026
1 of 2 checks passed
@lynnswap
lynnswap deleted the codex/issue-83-bounded-objc-metadata-reads branch August 26, 2026 16:45
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.

Unchecked Objective-C table and loaded-image reads can still trap on malformed metadata

1 participant