summaryrefslogtreecommitdiff
path: root/runtime/addon_test.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 00:15:56 -0300
committerGabriel Schneider <[email protected]>2026-11-25 00:20:24 -0300
commitfc45a7c8ed3b279a803dd8daad81329920b0493e (patch)
treed904db7d43fc9dd9fdaa9171ea0657879e3fcaee /runtime/addon_test.zig
parent7bac0f3d594b029a3631687ec3d8dd3626e0f447 (diff)
downloadpardes-fc45a7c8ed3b279a803dd8daad81329920b0493e.tar.gz
pardes-fc45a7c8ed3b279a803dd8daad81329920b0493e.zip
dump: a load refused after the core reads none of the namespace's opens again: they are what the load read, freed by the rollback, and their count may be the damaged one the load refused: a refused load's teardown (`p.fs.deinit` after `l.rollback()` in loadKnowing and loadImage) walked `opens[0..opens_len]` as the dump gave them; found by the 40,000-seed fuzz on the walk UI's merged tree M1 (xvnytwqm); RUN FIRST: fuzz.zig "a dump and an image cut ..." at join seed 31554: `panic: index out of bounds: index 255, len 64` (fs.zig:1029, Namespace.deinit, from dump.zig:402's errdefer: the dump's opens_len past the 64 slots, refused by walk.holdTo, then read that far by the teardown); and dump.zig's new test, a session with a script's open holding a half-written line (`pending`) whose load is refused after the core (a mount of the same name dialled elsewhere: error.MountConflict, dump.zig:432): `panic: double free` of the open's 9 bytes, the first free `l.rollback()` (dump.zig:401), the second Open.deinit through Namespace.deinit; THE CAUSE: the errdefer of both loaders tears the namespace down for what Pardes.create made (its log, its out, its mounts), and Namespace.deinit frees its opens too, which the load had read in place: the rollback's to free; THE FIX: the errdefer sets `p.fs.opens_len = 0` before `p.fs.deinit` (both loaders); a user could hit the double free with no damage at all: a Restore or a join of a dump taken while a script held an open with something in it (a half-written line, a frozen listing, a run's output) into a process started with a mount of the same name dialled elsewhere; the index past the slots only with a damaged or hostile dump; TESTS: dump.zig 'a load refused after the core frees what a script's open held once: the rollback's, not the namespace's' (fails before: double free), fuzz.zig checks join seed 31554 by name (fails before: index out of bounds); the fuzz at 40,000 join and 1,779 image seeds green in 158 s
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'runtime/addon_test.zig')
0 files changed, 0 insertions, 0 deletions