omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / evidence / SECURITY-673 / exec1 / REPORT.md
| 1 | # Native descriptor boundary prerequisite for #670 |
| 2 | |
| 3 | Status: bounded Linux AArch64 descriptor handling QUALIFIED; full #670 remains OPEN. |
| 4 | |
| 5 | Threat: a child executable unintentionally inherits an already-open file/socket/device capability |
| 6 | from its trusted caller. Protected asset: resources accessible through extra inherited descriptors. |
| 7 | The enforcing code is `seed/omc/omc.om:hpack` in the existing `execprog` lowering. After complete |
| 8 | packet validation and before `execve`, generated code invokes Linux syscall436, |
| 9 | `close_range(3, UINT_MAX, CLOSE_RANGE_UNSHARE)`. This preserves only caller-assigned standard |
| 10 | streams and obtains a private descriptor table. On any nonzero result, `execve` is skipped and |
| 11 | the kernel error is returned. There is no finite-descriptor-loop or permissive fallback. |
| 12 | The Linux API contract is documented at https://man7.org/linux/man-pages/man2/close_range.2.html . |
| 13 | Local `asm-generic/unistd.h` and `linux/close_range.h` independently identify syscall436 and flag2. |
| 14 | |
| 15 | Actual integration tests are seeded `exec-parent.om` and `exec-child.om`. Each test creates a |
| 16 | disposable synthetic-secret file, holds it at descriptors3 and65537 without close-on-exec, creates |
| 17 | pipes for public input/output, forks and executes the real compiled child. The child must receive |
| 18 | EBADF for both extra handles and exchange the exact public payload through its assigned streams. |
| 19 | The parent rereads its own synthetic file after the child exits, proving its descriptor table was |
| 20 | preserved. Missing executable mode checks closure even when `execve` returns ENOENT. A high-only |
| 21 | control closes descriptor3 before exec to isolate65537. No private data or device handles are used. |
| 22 | |
| 23 | Author results in `exits.txt`: green0/1/2=0; old-compiler red0=42, red1=55, red2=43. These are |
| 24 | specific failed assertions about low-handle inheritance, error-path inheritance and high-handle |
| 25 | inheritance. They are ordinary exits, not crashes. `unavailable3=0` is a separately declared |
| 26 | test of a compiled source mutant replacing syscall436 with unsupported999; it requires ENOSYS |
| 27 | and no child execution. `injected3=0` separately uses external strace fault injection on the real |
| 28 | close_range call. Neither is physical old-kernel qualification. `traced0/1=0` confirm successful |
| 29 | and missing-path exec ordering with real Linux calls. Every trace contains synthetic data only. |
| 30 | |
| 31 | The independent checker is the external kernel/strace observation plus a separately run review |
| 32 | of exact sources and real child behavior. Independent review/raw artifacts are retained under |
| 33 | `independent670`. It reproduced all three positive cases, all old-compiler failures and the |
| 34 | unavailable-syscall control. All source, compiler, binary and tool hashes are in `identities.txt` |
| 35 | and the independent report. Stage1 and stage2 equal6b5d9403; this is same-lineage reproducibility. |
| 36 | |
| 37 | Existing `sh seed/host/check.sh` exited0 with its retained host suite,41 negative controls and70 |
| 38 | original fixture comparisons. `host-check.*` records the actual run. The complete native669 gate |
| 39 | also exited0 on this compiler; `gate669.*` and its artifact archive retain the raw result. Existing |
| 40 | #659 modules were replayed unchanged natively: action219, delegation74, reuse74 assertions pass. |
| 41 | The existing L775 benchmark core also rebuilt and passed185 checks. Those separate component |
| 42 | replays qualify compatibility only, not durable dispatch, authenticated policy or evaluator custody. |
| 43 | |
| 44 | Raw author build sequence: |
| 45 | |
| 46 | ```text |
| 47 | seed/rung4/om4.bin < seed/omc/omc.om > build/security673-exec/stage1 |
| 48 | readelf -h build/security673-exec/stage1 |
| 49 | chmod +x build/security673-exec/stage1 |
| 50 | build/security673-exec/stage1 < seed/omc/omc.om > build/security673-exec/stage2 |
| 51 | cmp build/security673-exec/stage1 build/security673-exec/stage2 |
| 52 | chmod +x build/security673-exec/stage2 |
| 53 | build/security673-exec/stage2 < seed/qualification/security673/exec-parent.om > build/security673-exec/exec-parent |
| 54 | build/security673-exec/stage2 < seed/qualification/security673/exec-child.om > build/security673-exec/exec-child |
| 55 | ``` |
| 56 | |
| 57 | Each exited0; both test executables were inspected with readelf and made executable only after |
| 58 | successful builds. Build stderr is retained. Each fresh test directory contains a copy of the child: |
| 59 | |
| 60 | ```text |
| 61 | cd build/security673-exec/traced0 |
| 62 | printf '\000' | timeout 10s strace -f -o ../../../evidence/SECURITY-673/exec1/traced0.strace -e trace=close_range,execve,read,write ../exec-parent |
| 63 | exit0 |
| 64 | ``` |
| 65 | |
| 66 | `traced1` uses byte1 and checks missing executable. `green2` uses byte2. `red0/1` use the initial |
| 67 | parent compiled by7c25129a; `red2` uses the final parent compiled by that same old compiler. |
| 68 | The exact independent commands for the final sources and every result are in `independent670/REPORT.md`. |
| 69 | The author's initial identity-glob command encountered a directory and exited1; it was an archival |
| 70 | command error, not a passing test. The corrected explicit-file identity command produced the manifest. |
| 71 | |
| 72 | Residual scope: kernel, filesystem and trusted caller are assumed. Stdio must be intentionally |
| 73 | assigned. Higher-descriptor inheritance is unsupported; failure after successful closure leaves |
| 74 | extra handles closed. Ambient working directory, filesystem paths, networking, subprocess creation, |
| 75 | CPU/memory/output limits, grant generations and revocation fencing are not confined by this change. |
| 76 | Arbitrary native code still has ordinary user authority. The existing trusted launcher and capability/ |
| 77 | durable-effect owners must enforce those remaining requirements. No complete sandbox or #670 closure |
| 78 | is claimed. The original DeepSeek C candidate remains preserved on its original branch; this proposal |
| 79 | contains only seeded first-party implementation and tests and does not qualify that C consumer. |