[PR #586] [MERGED] fix(native): decode Mach protection bits in their proper positions #2087

Closed
opened 2026-10-16 21:14:04 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/586
Author: @rudycelekli
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @morluto

Base: main ← Head: campaign/rea-native-investigate-20261005


📝 Commits (1)

  • ac2870a fix(native): decode Mach protection bits in their proper positions

📊 Changes

2 files changed (+26 additions, -2 deletions)

View changed files

📝 src/native/parsers/otool.ts (+2 -2)
➕ tests/boundary/providers/native/nativeNumericPermissions.test.ts (+24 -0)

📄 Description

What changed

Numeric Mach VM protections used Unix-style bit order, swapping VM_PROT_READ and VM_PROT_EXECUTE. A read-only __LINKEDIT segment was reported as executable and unreadable. Decode read=1/write=2/execute=4 for both initial and maximum protections.

Verification

Eight numeric masks (hexadecimal and decimal) exercise the production parser; four fail on upstream and all eight pass after the fix. The complete native boundary directory passes 57 tests. A locally source-built C executable captured with xcrun clang/otool verifies its writable __DATA and read-only __LINKEDIT segments.

  • npm run check:pr
  • npm run check:ci
  • npm run verify:package
  • npm pack --dry-run

Native clang/otool ran on macOS arm64. Hopper and Ghidra are unrelated to this parser and were not run.

AI assistance was used to investigate, implement, and test this change. Commits are signed and include a DCO sign-off.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/586 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `campaign/rea-native-investigate-20261005` --- ### 📝 Commits (1) - [`ac2870a`](https://github.com/morluto/rea/commit/ac2870abf62572bd4628bc175876dd8043357fda) fix(native): decode Mach protection bits in their proper positions ### 📊 Changes **2 files changed** (+26 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/native/parsers/otool.ts` (+2 -2) ➕ `tests/boundary/providers/native/nativeNumericPermissions.test.ts` (+24 -0) </details> ### 📄 Description ## What changed Numeric Mach VM protections used Unix-style bit order, swapping VM_PROT_READ and VM_PROT_EXECUTE. A read-only __LINKEDIT segment was reported as executable and unreadable. Decode read=1/write=2/execute=4 for both initial and maximum protections. ## Verification Eight numeric masks (hexadecimal and decimal) exercise the production parser; four fail on upstream and all eight pass after the fix. The complete native boundary directory passes 57 tests. A locally source-built C executable captured with xcrun clang/otool verifies its writable __DATA and read-only __LINKEDIT segments. - `npm run check:pr` - `npm run check:ci` - `npm run verify:package` - `npm pack --dry-run` Native clang/otool ran on macOS arm64. Hopper and Ghidra are unrelated to this parser and were not run. AI assistance was used to investigate, implement, and test this change. Commits are signed and include a DCO sign-off. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:14:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2087
No description provided.