code wiki / (root) / nx_tool_exec_allow_gate.nx

nx_tool_exec_allow_gate.nx

buildroot/runtime/nx_tool_exec_allow_gate.nx

5962 B98 linesdepth 4pulls 5 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 ew tea_write_testconf e_slen tea_resolve_from tea_name_ok sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close tea_field_eq_n tea_field_eq e_streq en tea_run_from tea_resolve_from ↻ tr_run1_to sys_mmap ↻ tr_run_capture_to tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork sys_close ↻ sys_dup3 sys_execve_clean sys_close ↻ sys_execve sys_exit sys_read ↻ sys_wait4 wait_exit_code sys_mmap ↻ sys_pipe2 ↻ sys_fork ↻ sys_close ↻ sys_default_signal sys_mmap ↻

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() -> i64
called by 1: main calls 1: e_slen
28func main() -> i64