nx_osattest_gate.nx
buildroot/runtime/nx_osattest_gate.nx
about
nx_osattest_gate.nx -- GATE for LR6 (lang.plan rung LR6, symbol nxos_lang_ring_attest).
SUBJECT: the DEPLOYED nx_osattest organ, driven end-to-end against a COMPILER THE CALLER NAMES.
The compiler is argv[1] and is MANDATORY: this gate exists to compare a challenger compiler against
the live one, and a silent default would produce a fully-formed verdict about a stale leftover binary.
WHAT IT PROVES ABOUT THE ATTESTER (not about the estate's cleanliness -- a REFUSED closure is data):
* its partition SUMS to the population it declares;
* a source that MUST be refused under a live mode is counted REFUSED and the DECLARED RULE is
NAMED, so a refusal for an unrelated reason cannot wear the mode's name;
* a clean source is still counted ATTESTED under that same live mode -- an attester that refused
everything would score perfectly on the refusal tooth alone;
* a mode that is NOT enforcing is UNOBSERVABLE and is counted NEITHER clean NOR refused. This is
the load-bearing neg-control: nx_compile_x86's long-flag dispatch keys on ONE BYTE (arg[2]), so an
unrecognised flag is SILENTLY IGNORED and the compile returns 0. The fixture axis BOGUS carries a
real-looking flag the compiler does not know; an attester that trusted flag NAMES would report it
ATTESTED, and its green would be indistinguishable from a true one.
FIXTURES ARE ASSEMBLED AT RUNTIME under /tmp/nxosattg/ and every receipt this gate produces is written
THERE -- the production receipt at knowledge/status/ is never touched by a gate run.
The two closure subjects are REAL estate sources whose behaviour under --ptrprov is already gate-proven
by nx_boundscheck_gate (T5 in-range accepted, T9 const-OOB builds under default, T10 refused under
ptrprov), so the expectations here are inherited measurements, not this author's guesses.
usage: nx_osattest_gate [organ_elf] [compiler_elf] (CWD = the tree root, like nx_cc_equiv_gate)
organ_elf defaults to ../nx_osattest.elf; SUBJECT-FIRST because that is where nx_gate_bite puts it.
compiler_elf defaults to the gate_compiler row of knowledge/lang_attest.conf, and with neither the
gate REFUSES -- the binary under test is always named, never found lying around.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_ccgate_lib.nxnx_lineconf_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 41 | const OG_CONF: *u8 = "knowledge/lang_attest.conf" |
| 42 | const OG_CCKEY: *u8 = "gate_compiler" |
| 43 | const OG_CCW: i64 = 1024 |
| 45 | const OG_WORD: i64 = 8 |
| 46 | const OG_ARGV: i64 = 8 |
| 49 | const OG_RC_OK: i64 = 0 |
| 50 | const OG_RC_USAGE: i64 = 2 |
| 51 | const OG_RC_UNPROVEN: i64 = 3 |
functions
| 53 | func og_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 57 | func og_err(s: *u8) -> i64 { sys_write(2, s, og_len(s)); return 0 } |
| 60 | func og_write(path: *u8, s: *u8) -> i64 |
| 70 | func og_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, outp: *u8, errp: *u8) -> i64 |
| 86 | func og_exists(p: *u8) -> i64 { let fd: i64 = sys_openat_rd(p); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 95 | func og_resolve(p: *u8, anchored: i64, out: *u8, cap: i64) -> i64 |
| 117 | func og_lines2(path: *u8, n1: *u8, n2: *u8) -> i64 { return ccg_file_count_lines_with2(path, n1, n2) } |
| 119 | func main(argc: i64, argv: *i64) -> i64 |