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 / seed / host / execenv / README.md
| 1 | # execenv (keyword 233) |
| 2 | |
| 3 | `r = execenv A off n B off m` is `execprog A off n` with a private environment. |
| 4 | |
| 5 | - **A, the argv packet.** It follows execprog's rules: a u16 count, then u16-length records, and the first record (the program path) must be nonempty. |
| 6 | - **B, the environment packet.** It is packed the same way, with these limits: |
| 7 | - the count is 1..64; |
| 8 | - every record is nonempty; |
| 9 | - the packet is 2..4096 bytes; |
| 10 | - it has no embedded zero byte and no trailing bytes. |
| 11 | - **Order of operations.** Both packets are checked (trap 3) before the descriptors above 2 are closed (`close_range(3, ~0, CLOSE_RANGE_UNSHARE)`). Then `execve(path, argv, envp)` runs. |
| 12 | - **Return value.** Like execprog, it returns only on failure, with a negative errno. |
| 13 | - **Refusals.** It is refused in function mode (error 9) and inside contracts (error 30). |
| 14 | - **Targets.** AArch64 Linux and x86linux. |
| 15 | |
| 16 | ## Gate files |
| 17 | |
| 18 | `execenv.cases` is run by the OM-2 conductor (`seed/qualification/om2/gate.om`) from `seed/host/check.sh`. All gate logic is in `.om` files: |
| 19 | |
| 20 | - **`execenv.om`, the fixture.** |
| 21 | - In parent mode it runs 15 checks. |
| 22 | - It re-executes itself in child mode with three entries: `AIEN_COCKPIT_TOKEN`, `AIEN_COCKPIT_ADDR` and `HIVE_DB_PATH`. |
| 23 | - The child checks that its environment is exactly those entries. |
| 24 | - The negative control: under plain `execprog`, the child sees no variables. |
| 25 | - It also checks malformed packets, the 64-entry and 4096-byte limits, an empty non-first record, an empty program path and ENOENT. |
| 26 | - The parent exits with the number of the first failed check. |
| 27 | - **`x86-target.om`.** A `target x86linux` header that is prepended to `execenv.om`. Those runs go through binfmt `qemu-x86_64`: this is emulator evidence, not hardware qualification. The binfmt registration is a host prerequisite. |
| 28 | - **`oracle.om`.** It execs `/usr/bin/printenv` with the same three entries, and the output must equal `printenv.want`. Given an argument, it uses `execprog` instead, and the output must be empty. |
| 29 | - **`fnmode.om`, `contract.om`.** The refusal cases. |
| 30 | - **`mutants/*.from|.to`.** Four `omc.om` mutants. Each one is built by the conductor and must make the fixture fail at the named check: |
| 31 | - AArch64 envp replaced by an empty list; |
| 32 | - AArch64 nonempty-record rule removed; |
| 33 | - x86 envp replaced by an empty list; |
| 34 | - x86 rule weakened so that only the first record must be nonempty. |
| 35 | |
| 36 | ## ORACLE |
| 37 | |
| 38 | `/usr/bin/printenv` (GNU coreutils 9.4 on the qualifying host) is an **ORACLE**. It is an independent host binary that differs from the fixture by construction. It is used only to confirm what a child process actually receives. It is never built, linked or shipped. |