code wiki / (root) / nx_tool_exec_allow_gate.nx

nx_tool_exec_allow_gate.nx

buildroot/runtime/nx_tool_exec_allow_gate.nx

8047 B125 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic tool
docsdependenciesstructsconstsfunctions

about

nx_tool_exec_allow_gate.nx -- GATE for R1 (nx_tool_exec_allow), composing R0 (nx_tool_run). Proves the execution allowlist is fail-closed and never-brick: only an allowlisted, gate-GREEN row resolves to an ELF path and runs; a non-GREEN row is present-but-blocked; an unknown name and a traversal name ("../x") both refuse; and a GREEN row actually EXECUTES its ELF and captures real stdout. Target = the canonical no-op nx_tool_ping (a SEPARATE tiny ELF, zero recursion risk). Writes its allowlist to /tmp (never touches a real config). PREREQ: build nx_tool_ping FIRST (produces _offc/nx_tool_ping.elf). license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_tool_exec_allow.nx nx_gate_verdict.nx nx_tool_exec_allow_gate.nx

imports: nx_tool_exec_allow.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main e_streq ew tea_write_testconf e_slen tea_resolve_from tea_name_ok tea_field_eq_n tea_field_eq en tea_run_from tea_resolve_from ↻ tr_run1_to sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ tr_run_capture_to tr_run_capture_tr tr_run_capture_core tr_run_capture_core_owned tea_resolve_pinned_from tea_name_ok ↻ tea_read_conf tea_field_eq_n ↻ tea_field_eq ↻ tea_tokenize_checked tea_tokenize tea_run_pinned_from

structs

none

consts

11const TEA_TESTCONF: *u8 = "/tmp/nx_tea_test.conf" as *u8

functions

13func ew(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
14func en(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
called by 1: main
15func e_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } if b[i]!=(0 as u8){return 0} return 1 }
called by 1: main
16func e_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: tea_write_testconf
19func tea_write_testconf(self:*u8) -> i64
called by 1: main calls 1: e_slen
33func main(argc:i64, argv:*i64) -> i64