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 / branchforms1 / REPORT.md
| 1 | # Branch-form semantic qualification for Omega #669 |
| 2 | |
| 3 | Date: 2026-10-23. Parent tracker: #673. Branch: `fix/security673-qualified`. |
| 4 | Base: `540e8bcd` plus the changes in this directory. Platform: Linux AArch64, native execution only. |
| 5 | |
| 6 | ## Threat and protected property |
| 7 | |
| 8 | Source can place a conditional or loop edge at or beyond the AArch64 imm19 range, or at a function |
| 9 | boundary where an encoder could patch the wrong place. The protected asset is correspondence between |
| 10 | the source control flow and the emitted branch target. The failure mode under test is silent |
| 11 | truncation or a branch to a different instruction, not host compromise. |
| 12 | |
| 13 | Enforcement remains the single checked path in `seed/omc/omc.om`: `disp19` (line 935) derives and |
| 14 | checks the signed word displacement, and `patch19` (line 947) is the only imm19 writer. `patch26` |
| 15 | (line 952) writes unconditional B and relies on the inspected 8 MiB output-pool capacity, which is |
| 16 | below the signed 26-bit reach. |
| 17 | |
| 18 | ## Encoder inventory |
| 19 | |
| 20 | | Source form | Enforcing emitter | Branch instruction | Patching path | |
| 21 | | --- | --- | --- | --- | |
| 22 | | `if`/`while` condition on a value | `cond` (line 2999) | CBZ Xr; B.cond for a constant condition | `patch19` in `s_end` | |
| 23 | | `if`/`while` condition with relational operands | `binop`/`conds` | B.cond with the inverted condition | `patch19` in `s_end` | |
| 24 | | `else` | `s_else` | B (unconditional) over the else part | `patch26` | |
| 25 | | `while`/`for` back edge | `s_end`, `blo` (line 3055) | B / B.LO to the loop head | `patch19` | |
| 26 | | Local array fill | `sa_arr` | B.LO back to the fill loop | `patch19` via `blo` | |
| 27 | | Trap sites, including shift/width checks | `trapsite` (line 1813) | CBNZ/B.HS to the trap stub | `patch19` in `finish` | |
| 28 | | Boolean branch materialization | `bbr` paths | B.cond | `patch19` | |
| 29 | | Host-word packet/error branches | `hpack`, `hpath`, `hargs`, `hwaitio` | B.cond/CBZ to a return/error path | `patch19` | |
| 30 | |
| 31 | All imm19 users flow through `disp19`; there is no second relocation encoder. The compiler does not |
| 32 | expand a branch or relax layout. A displacement outside `-1048576..+1048572` bytes, or an unaligned |
| 33 | target, is refused with error 24 before an artifact is accepted. The declared refusal bound is |
| 34 | therefore 2^18-1 words forward and 2^18 words back, matching the ISA field. |
| 35 | |
| 36 | ## Added semantic cases |
| 37 | |
| 38 | `branch-forms.om` generates fifteen fixed programs. Each is compiled by the rebuilt compiler and |
| 39 | executed natively; the coordinator compares the actual exit: |
| 40 | |
| 41 | | Mode | Form | Expected exit | |
| 42 | | --- | --- | --- | |
| 43 | | 0 | `if eq` register, taken | 11 | |
| 44 | | 1 | `if ne` register, not taken | 12 | |
| 45 | | 2 | `if lt` taken | 11 | |
| 46 | | 3 | `if le` taken | 11 | |
| 47 | | 4 | `if gt` taken | 11 | |
| 48 | | 5 | `if ge` taken | 11 | |
| 49 | | 6 | `if eq` against zero (CBZ path) | 11 | |
| 50 | | 7 | `if ne` against zero, false | 12 | |
| 51 | | 8 | `if eq` false | 12 | |
| 52 | | 9 | `while` back edge | 3 | |
| 53 | | 10 | `for` back edge | 3 | |
| 54 | | 11 | `if`/`else` unconditional B | 21 | |
| 55 | | 12 | branch inside a called function | 30 | |
| 56 | | 13 | shift-width trap site | 107 | |
| 57 | | 14 | divide-by-zero trap site | 102 | |
| 58 | |
| 59 | These complement, rather than replace, the existing range cases: `boundaries` checks the encoder |
| 60 | extrema directly, `positive`/`negative` check source-level range refusal, `array-fill` exercises the |
| 61 | real backward B.LO caller, and `mutant` proves a weakened guard is caught by independent decoding. |
| 62 | |
| 63 | ## Executed results |
| 64 | |
| 65 | | Command | Result | |
| 66 | | --- | --- | |
| 67 | | `build/gate669-new` (normal) | exit 0, `GATE669 PASS` | |
| 68 | | `build/gate669-new 3` (source campaign) | exit 0, `GATE671 SOURCE PASS` | |
| 69 | | `sh seed/host/gate.sh` | exit 0, all nine host groups pass | |
| 70 | |
| 71 | Raw stdout is `gate-branch.log`, `gate-hostile.log` and `host-gate.log`; stderr for the gate runs is |
| 72 | empty. `identities.txt` binds the compiler source, gate, corpus, rebuilt compiler and logs by SHA256. |
| 73 | |
| 74 | ## Residual limits |
| 75 | |
| 76 | - Long backward source reachability is still not established. The backward B.LO caller is a short |
| 77 | array-fill loop; the direct encoder extrema are synthetic. This is a bounded test obligation, not |
| 78 | a reachability proof. |
| 79 | - The gate, corpus and compiler share the seed lineage. GNU objdump supplies independent decoding for |
| 80 | the range probe; no diverse-double-compilation claim is made. |
| 81 | - This does not close #669, #671 or #673. Release integration, the remaining #670 authority contract, |
| 82 | and independent final-source review remain with their existing owners. |