interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / qualification / security673 / README.md

197 lines · 14108 bytes Raw Blame History Rendered
1# Seeded security qualification
2
3This directory extends the existing native host compiler profile. It is not an alternative compiler,
4authority service, store, or release path. Existing L408 compiler integration and Renda review remain.
5
6## Branch gate (#669)
7
8Linux AArch64 only. Requires the existing seed reconstruction tools and GNU objdump 2.42 at
9`/usr/bin/objdump`. From a fresh checkout at the reviewed source commit:
10
11```sh
12sh seed/omega-from-seed.sh
13seed/out/omc < seed/qualification/security673/gate669.om > build/gate669
14readelf -h build/gate669
15chmod +x build/gate669
16build/gate669 > build/gate669.log 2> build/gate669.err
17```
18
19Run each command only if the previous command exits zero. In particular, a failed compilation
20must never be made executable or run. Existing bootstrap shell is a retained seed prerequisite;
21all new first-party qualification logic here is `.om`. `readelf` is an external format inspection,
22not a correctness proof. The gate refuses an existing `build/security673-native` directory with91
23instead of overwriting evidence. Preserve and rename that directory before a fresh run.
24
25The gate rebuilds the actual compiler twice, compares both binaries, builds its helpers, and saves
26every input, output and child stderr under that new directory. Standard output records exact child
27commands, redirects, observed exits and expected exits. Gate success is0. Compiler refusal is24
28with empty output; malformed oracle inputs are62; independently decoded target mismatch is61.
29Unexpected exit, signal, timeout, malformed executable, or I/O failure fails the gate. Each directly
30spawned child has a30-second deadline. This is not a sandbox, process-tree budget, or full resource
31limit. These trusted synthetic tests do not spawn grandchildren. Run no untrusted workload through
32this coordinator as if it provided isolation.
33
34`build/gate669 0`, `build/gate669 1`, and `build/gate669 2`, each with fresh scratch, are intentional
35negative controls for unexpected exit7, signal9, and a45-second child exceeding the30-second
36deadline. Each must fail with99; the latter two log the raw low wait-status byte9. They never
37print the success line. An unexpected gate crash is INVALID, never a passing negative control.
38
39The actual compiler encoder `bdisp` (every B.cond/CBZ/CBNZ imm19 and every B/BL imm26 site) is
40exposed by an exact-once source transform, not copied into a test implementation. Probe cases 0..7
41accept the imm19 and imm26 extremes with the exact field, 8..15 refuse one word past each limit and
42misaligned ends with error 24, 16..17 show the AArch64 output ceiling (error 14) that keeps every B/BL
43inside its signed 128 MiB reach: 16 accepts a word at 8 MiB (the ceiling through omc f4fa7951; since
442026-11-11 the output grows in omc's arena, OMEGESE 9.6) and 17 refuses the first word at 128 MiB, so imm26 error 24 is a defence that no legal program reaches. The
45forward branch-limit mutant is compiled from a distinct transformed source; its output is decoded
46and rejected without execution. The range-free mutant (`branch-mutate 7`, then `0`) must answer 81
47on exactly the four out-of-range cases. Long backward imm19 from source is not reachable through
48`while`/`continue`: the loop-bound trap B.cs at the head reaches farther forward than the continue
49reaches back, so the forward limit refuses first. Corpus mode 4 rows: N = 3, 16 and 262131 (the largest
50accepted, continue 262142 words back) compile, decode with `branch-check 1` and exit 0; N = 262132,
51262133 and 262134 are refused with 24. (Through omc f4fa7951 the head's stubs sat after the function's
52`ret`, 4 words farther: 262127 was the largest accepted and 262128 the first refused. Since 2026-11-11 the
53stubs of a trap branch 512 KiB back sit in an island right after the loop, OMEGESE 9.6.) The range-free compiler accepts N = 262134 (continue 2^18 + 1
54words back) and its B.AL decodes to the wrong target (61); that output is never executed.
55
56GNU objdump is outside the seed compiler lineage. The `.om` checker consumes its selected text
57format and rejects the enumerated malformed/missing/duplicate/wrong-target controls. It is not
58a full disassembly grammar or authentication of attacker-supplied text. The checker and runner
59share the seed compiler lineage. Binary equality and SHA256 identities are reproducibility and
60identity evidence, not diverse compilation or proof of general semantic correctness.
61
62## Branch-form semantics (#669)
63
64`branch-forms.om` adds fifteen small programs covering every source conditional form: `eq`, `ne`,
65`lt`, `le`, `gt` and `ge`; the CBZ path for a value compared with zero; `while` and `for` back
66edges; the unconditional B over an `else`; a branch inside a called function; and the shift-width
67and divide-by-zero trap sites. The coordinator compiles and executes each and compares the exit
68with the fixed table in `formwant`. These cases check target selection, while `boundaries`,
69`positive`, `negative`, `array-fill` and `mutant` continue to check the imm19 range and refusal.
70Corpus mode 3 (a trap, then 300000 one-word lines) was a `negative` row (error 24: the trap stub sat
71at the function's end) through omc f4fa7951; since 2026-11-11 omc places waiting trap stubs in an island
72(OMEGESE 9.6), so `trapfar` compiles it and runs it to trap 2 (exit 102), the CBZ landing on the island's code-2 stub.
73
74All imm19 writes still flow through `disp19`/`patch19`. The compiler does not expand or relax a
75branch: a target outside the signed 19-bit word displacement, or an unaligned target, is refused
76with error 24 before an artifact is accepted. Unconditional B uses `patch26` and the inspected
778 MiB output-pool capacity (through omc f4fa7951; since 2026-11-11 the AArch64 output ceiling is the
78128 MiB imm26 reach itself, OMEGESE 9.6, and long functions get trap-stub islands). Evidence is `evidence/SECURITY-673/branchforms1`.
79
80## Strict launch profile (#670)
81
82`execpure` (native host word 198) pins one executable as descriptor 3 and then applies a fixed
83kernel profile before `execveat(AT_EMPTY_PATH)`: Landlock execute/read only beneath that inode,
84`PR_SET_NO_NEW_PRIVS`, CPU/file/stack/core/process/descriptor/address-space limits, and a seccomp
85filter that allows only stdin read, stdout/stderr write, the pinned exec and exit. Any setup
86failure returns the kernel error; there is no weaker fallback.
87
88`pure-child.om` is the hostile consumer; `pure-launch.om` is the caller; `pure-raw.om` emits four
89fixed native images for absolute exec, raw open, raw getpid and a 1 GiB mmap. Build the launcher and
90child with the rebuilt compiler, create `build/security673-pure/private.data` and `judge.data`, then
91run `pure-launch build/security673-pure/pure-child` with `public-input` on stdin. Every assertion
92must pass and the protected files must be unchanged. Evidence and traces are
93`evidence/SECURITY-673/pure2`. This is a fixed strict profile, not a general sandbox; grant
94generations, revocation and durable budgets remain open under #670/#649.
95
96Descriptor scope is deliberate: generic `execprog` admits only descriptors 0, 1 and 2;
97`execpure` adds exactly one pinned executable descriptor (3). Arbitrary high-descriptor handoff is
98not part of the supported profile. A caller that needs other resources passes paths or data, not
99inherited authority, so numeric descriptor reuse cannot resurrect an old grant.
100
101Bypass controls remove one enforcement step at a time with `branch-mutate.om` and require the named
102result: seccomp removed lets raw getpid through (71), Landlock restriction removed lets the second
103image execute (77), CPU exhaustion dies with SIGXCPU (152), and a 1,048,577-byte write stops at the
1041 MiB file limit (0, 1,048,576 bytes). An unavailable close_range refuses the launch with 38.
105`pure-raw.om` accepts an optional absolute target path for the second-image and fixed-inode
106controls. Evidence is `evidence/SECURITY-673/pure3`; the earlier author run is `pure1`.
107
108## Bounded source ingress (#671)
109
110With fresh scratch, `build/gate669 3` runs twenty-two source cases through the real rebuilt compiler.
111The generator is `hostile-corpus.om`; the existing coordinator is reused. The campaign covers
112decimal length, nested values, nested blocks, large literals, function count, invalid control byte,
113oversized pool, unterminated quote, unknown name, long whitespace, input capacity and float literals
114of 1000001 zero digits (fraction, exponent, and an untyped literal typed by the other operand, also at
11570 digits). Twelve accepted fixed-compiler programs execute with expected exits; ten refused inputs
116leave empty artifacts. Both parities of the nested Boolean expression are exercised.
117
118The float cases close #965 findings: before the fix a fraction or exponent of more than 1000000 zero
119digits trapped 4 (exit 104) in the single-loop scans of `fparse`, `fexp` and `fbits`, and an untyped
120literal of 64 or more characters was re-read from the wrong span (`pos*64+len`), so `add 0..01.5 x`
121with `x = 2.0` silently computed 2.
122
123A separately compiled numeric-limit mutant changes the existing20-digit rule to21. It accepts
124the21-zero source, violating the published profile; the fixed compiler refuses6. That mutant's
125program is format-inspected and retained, not executed. The independent report records the
126distinction. The gate logs elapsed nanoseconds for each child. External `/usr/bin/time -v` can
127record observed campaign wall time and maximum resident memory; those observations do not
128establish a general complexity bound or enforce a kernel memory limit.
129
130This is a deterministic bounded source campaign. Other ingress paths, broad grammar/mutation
131fuzzing, authenticated canonicalization and kernel resource limits remain under their existing
132owners. Current evidence and independent review are `evidence/SECURITY-673/hostile1` and
133`independent671`. Earlier failed development fixtures are preserved and excluded from PASS.
134
135The same gate also runs nine packed-list cases through a compiled consumer. `packet-corpus.om`
136builds valid, empty-count, over-count, truncated-record, trailing-byte, empty-path, embedded-NUL
137and oversized-record packets; `pkt-consumer.om` reads one packet and calls `execprog`. Accepted
138modes execute `/bin/true`; malformed modes trap 3 with exit 103 before any kernel exec. Evidence is
139`evidence/SECURITY-673/packet1`; the wider ingress map is `evidence/SECURITY-673/ingress-inventory.md`.
140
141`renames` is qualified by seven cases: the accepted pair must rename the source and leave the
142destination, while one record, three records, either empty path, a trailing byte and an embedded NUL
143each trap 3 before the kernel rename. The consumer creates the source under the scratch directory,
144so the positive case also proves the packet was consumed exactly. Evidence is
145`evidence/SECURITY-673/renames1`.
146
147Path and argument boundaries are covered by seven more cases: a valid `fopen`; embedded-zero and
1484096-byte paths trap 3; an empty path returns the kernel's negative errno; `argread` into a short
149buffer returns -105 without changing the slice; an invalid index traps 3; and an exact-capacity
150read returns the length. Evidence is `evidence/SECURITY-673/paths1`. Path traversal is not confined
151by `fopen`; the strict launch profile is the confined path. Legacy manifest, receipt, RPC, model,
152trace and device parsers remain NOT_RUN.
153
154
155## Authority regression integration (source-reviewed, host-run)
156
157The existing `authority` campaign now includes `dispatch-order-gate.om`,
158`store-exact-gate.om` and `store-cleanup-gate.om` after the existing action,
159delegation, reuse, store, dispatch, SHA256 and lock gates. These are the same
160committed compilation units documented in `seed/authority/README.md`; the
161coordinator neither recomposes them nor changes their production components.
162The expected exits are all 0, with the following child stdout:
163
164- `dispatch order checks=3 fails=0`
165- `store exact checks=4 fails=0`
166- `store cleanup cases=18 fails=0`
167
168Each new gate is compiled through the existing `compile` path using the twice
169rebuilt compiler. Before running it, the coordinator creates a fresh numbered
170mode-0700 directory under its already-fresh `build/security673-native` directory.
171An existing directory or any mkdir error fails closed. Only the forked child
172changes into it, after opening stdin/stdout/stderr from the repository-root
173parent. Consequently each test's relative `build/authority-store` is private to
174that test, including the malformed files deliberately retained by store-exact.
175The parent, other gates and compiler invocations keep their original cwd.
176Existing authority gates keep their existing fixture paths; this change does
177not isolate or redesign those gates.
178
179The executable argument is an absolute path formed from checked `cwd` output
180and the exact numbered compiler artifact before the child changes directory.
181Path and argument-packet capacity failures refuse the run. Child `chdir` failure
182exits 97 before `execprog`; failed exec exits 98. The existing expected-exit,
183signal and deadline checks reject both, and no later PASS is reached. The log
184records the absolute executable, input/output/error artifacts and `cwd=` path.
185The filesystem separation is for fixture/evidence retention, not confinement or
186protection against a hostile actor replacing trusted checkout files. The three
187new tests do not intentionally launch an effect child on their expected paths.
188Their negative controls remain separate replay procedures, not coordinator runs.
189
190Source composition, path construction, identifier limits and fail-closed control
191flow were first checked without executing Omega binaries. Native run (2026-10-31,
192Linux AArch64, seed/out/omc 7a8b84fc): the full coordinator `gate669.om` exits 0
193with `GATE669 PASS`; the dispatch-order, store-exact and store-cleanup steps each
194log `exit=0 expected=0` for compile and run in their own `cwd=` directories. The
195three negative controls were replayed separately (see `seed/authority/README.md`)
196and each exits 1. This is host execution, not hardware qualification. Existing
197L408 compiler integration and Renda review ownership are unchanged.