code wiki / (root) / nx_orphan_reap_gate.nx

nx_orphan_reap_gate.nx

buildroot/runtime/nx_orphan_reap_gate.nx

6710 B141 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_orphan_reap_gate.nx -- BITE-PROVEN guard test for nx_orphan_reap's victim-side protection. WHY: nx_orphan_reap is destructive BY DESIGN. Its old guard screened the NEEDLE against a hand-typed denylist, which can never be sound -- the dangerous case is a needle that matches a protected process WITHOUT NAMING IT. Measured 2026-08-01: a reap aimed at :8447's owner would have killed the live nx_translate_daemon; it survived ONLY because the guessed name missed. This gate proves the new victim-side filter with BOTH polarities, because a protection cell that is green before the hazard exists proves nothing. THE TOOTH (gv_bite): a crafted PROTECTED sleeper must SURVIVE a reap aimed squarely at it (good==0), and an otherwise-identical UNPROTECTED sleeper must DIE from the same needle (bad==1). One tooth, both polarities -- a filter that spares everything would pass the first half and fail the second. license_tier: ORIGINAL expect_exit:0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_proc_ctl.nx nx_gate_verdict.nx nx_orphan_reap_gate.nx

imports: nx_syscalls.nxnx_proc_ctl.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 gv_ctr sys_mmap gv_head gv_puts sys_write sys_mmap ↻ og_spawn sys_fork sys_mmap ↻ sys_execve sys_exit sys_sleep_ms sys_mmap ↻ sys_munmap og_alive nx_kill sys_mmap ↻ pc_read_cmdline sys_openat_rd sys_read sys_close sys_munmap ↻ gv_check gv_puts ↻ gv_puts ↻ nx_kill ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap ↻ gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec

structs

none

consts

18const OG_CAP: i64 = 8192
19const OG_SIGTERM: i64 = 15
20const OG_SETTLE_MS: i64 = 400

functions

23func og_spawn(elf: *u8, tag: *u8) -> i64
48func og_alive(pid: i64) -> i64
74func main(argc: i64, argv: *i64) -> i64