code wiki / _hdl_build / _bs_poison.nx

_bs_poison.nx

buildroot/runtime/_hdl_build/_bs_poison.nx

5055 B112 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

_bs_poison.nx -- R1-T1-004 / X-CLEAN-002 the "next reproducer": try to make the LATENT nxasm rc=6 uninit-read DETERMINISTIC by POISONING the child's inherited context. R1-T1-004 pinned the class as parent-ctx x output-path (uninit-read in nxasm, value=parent-residue, relevance=path-slot) but the trigger went latent (fresh /tmp, residue gone). This probe floods the nxasm child's inherited ENVIRONMENT (the parent-controlled bytes that survive execve) with several poison patterns x sizes, plus a 1MB poison scratch fill, and assembles ONE real .s to a genuinely WRITABLE output path under each config. CONTROL = clean env (must rc=0). If ANY poison config makes a WRITABLE path fail (rc!=0), the uninit-read picked up poison -> DETERMINISTIC TRIGGER FOUND (then bisect nxasm). If all stay rc=0, the defect is not reachable via this vector (strengthens latent/non-reproducible -> no-overclaim close). Pure diagnostic; NO nxasm edits. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _bs_poison.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap bp_try sys_mmap ↻ bp_run sys_fork sys_execve sys_exit sys_mmap ↻ sys_wait4 bp_poison_env sys_mmap ↻ bp_puts sys_write bp_putn sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

14func bp_puts(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 calls 1: sys_write
15func bp_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;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 calls 2: sys_mmapsys_write
18func bp_run(path: *u8, argv: *i64, envp: *i64) -> i64
31func bp_try(asm_tool: *u8, spath: *u8, outpath: *u8, envp: *i64) -> i64
called by 1: main calls 2: sys_mmapbp_run
38func bp_poison_env(pattern: i64, count: i64, slen: i64) -> *i64
called by 1: main calls 1: sys_mmap
56func main() -> i64