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 / effects / README.md

100 lines · 6834 bytes Raw Blame History Source

effects: capability manifest derived from Omega source

A seeded-Omega program reaches the kernel only through the closed keyword set in OMEGESE section 10 and MAPPING.md: there is no raw syscall and no address-to-pointer conversion. The host words that appear in a unit are therefore a complete, finite list of the OS effects it can have. This tool turns that list into a manifest, checks it against the compiled binary, and emits a seccomp filter that enforces it.

seed/out/omc < seed/effects/effects.om > effects && chmod +x effects
effects src [allow=C,..] < unit.om      host words, classes, Linux syscalls; policy check
effects elf < binary                    syscalls the omc ELF can issue (fail closed)
effects verify SRC BIN [allow=C,..]     ELF syscalls must lie within the source manifest
effects bpf [launch] < unit.om          seccomp cBPF allow-list for bwrap --seccomp
effects table                           word, class and syscalls, one per line

Classes: io (read, write), fd, path, net, proc, ident, time, env, random, device. exit/traps (syscall 93) are always allowed.

Exit status: 0 pass, 1 refused or undeclared syscall, 2 usage, 3 invalid or unresolvable input, 4 read error.

elf treats every SVC in an executable load segment as reachable. Each SVC must be immediately preceded by MOVZ X8,#n, and the segment may contain no BR/BLR; both rules apply to every word of the segment, instruction or not. No direct branch may land on an SVC. That rule applies to the words control can reach: omc puts texts in the same segment as the instructions, and a text can hold the bit pattern of a branch (the four bytes @-(6 read as TBZ), so holding data to it refused correct programs, omc itself among them. Reach starts at the entry word and follows the next word and the target of every direct branch; it stops after an unconditional B, a RET, and an SVC whose number is 93 or 94 (exit, exit_group). Such an SVC does not return, and the reason is part of the rule: it can be entered only through the MOVZ X8 before it, because a reached branch onto it is refused and an entry point on an SVC is refused, so X8 holds 93 or 94 when it runs. Reach must not lose control, so three more things are refused: an entry point that is an SVC, a reached direct branch whose target lies outside the segment, and a reached word that falls through past the last word of the segment. A reached register-branch instruction other than RET (the pointer-authentication forms, ERET) and a reached BC.cond are refused as well, because the walk cannot follow them. When the entry point is not in the segment, every word is held to the rule. Anything else is ELF UNRESOLVED (exit 3). W+X segments are refused. A binary from another producer will usually fail closed.

What this does not show: that a RET returns to the word after a BL. The calling sequence the compiler emits is relied on for that, as it was before this rule was narrowed.

Qualification

sh seed/effects/check.sh (pinned omc; strace, bwrap, od and dd as oracles):

Limits