diff --git a/.crumb b/.crumb index 59286e8e8..196b83fab 100644 --- a/.crumb +++ b/.crumb @@ -108,14 +108,14 @@ } ], "children_root": "sha256:4b14d5958f47b6630055cf4a2246a89549620f97b64495ebf50844cac8cae2f9", - "compiled_at": "2026-10-31T05:02:41Z", + "compiled_at": "2026-10-31T05:03:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:0c9346d8bf0cc410efbf1c4861608ccd8bc8128a521489807da6f8c7aec6188f", - "evidence_files": 14991, - "evidence_root": "sha256:1b7f806cd08d07db412b46fe3506748b42e94f87ff330d49cc47364831dff4b8", - "files": 23188, - "generated_at_commit": "7d57fa6bb70b42ab893e7df864180a31755f28c3", - "source_tree": "sha256:46a3f83a82fb0faf8cae952713f5cbcfe07fd18c0a27c2f8dab3cca8c19fc7f2" + "digest": "sha256:4852afebbd50704c45de5523ee5ea12c4a022633bbdf191f67f257e731decc21", + "evidence_files": 14992, + "evidence_root": "sha256:af2893ddec374ff41e6ac67782c79466fd24e2968169bb97988bd8b02ae16c23", + "files": 23189, + "generated_at_commit": "7e38ee6f352002e180b2932afbca8e281b42bea0", + "source_tree": "sha256:f2dad2afe172d68e61cfccdecb406153892438f6754fabdf63cb92b6cad3e86c" }, "owner_lane": "", "provenance": { diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 522977f8d..0c7f98867 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -7,6 +7,7 @@ The current development method is [Human-Directed Agentic Engineering (HDAE)](RE | Model | What it did | |---|---| +| Codex | Seeded authority lock unlink-error reporting and deterministic directory/missing-path regression (source-reviewed; native execution pending) | | Claude Opus 5.5 (via omp) | Made `om/evidence/parity/run.sh` independent of the filesystem under `TMPDIR`. The pathtree and digtree listings hashed each directory's `find %s` size, which is 4096 on ext4 and 40..3800 on tmpfs, so the harness failed on tmpfs with correct output. Directories now list `-` for size. The two expected hashes were re-derived from the same trees: on ext4 the old listing still hashes to the recorded C-oracle values, and the new one matches on ext4 and tmpfs. The mkdir_mode and file_mode mutants are still killed. | | OpenAI Codex | C6 comparison harness: preserve decoder exit status before normalization; host-only serial and parallel regression controls reject nonzero exits despite identical output. | | Claude Opus 5.5 (via omp) | #944 (#601, #560): the OM_COMPLETION FR-5 row records the shipped handle-checked mapping and device words (ids 166..177, contracts in `seed/host/MAPPING.md`, the four `seed/host/tests` units run by `seed/host/gate.sh`), and FR-5 leaves the decision-blocked list. The tern header's shared-memory comment states the 32 KiB QMD limit and that one 8192-column x chunk is 16 KiB. Docs and comments only. | diff --git a/evidence/SECURITY-673/lock-release-errors/REVIEW.md b/evidence/SECURITY-673/lock-release-errors/REVIEW.md new file mode 100644 index 000000000..f08b7cd63 --- /dev/null +++ b/evidence/SECURITY-673/lock-release-errors/REVIEW.md @@ -0,0 +1,54 @@ +# Lock release error reporting: source-only candidate + +Source base: `a35697e94b5eeb72efadfee6edab7f14344aea43` (`fix/security673-qualified`). +Stack parent: `666728518ec0ce7580328dc926b5db8409ef664a` (#686). +Review date: 2026-10-24. Scope: #649/#670 authority store, #673 tracker. +Remote base was rechecked before editing; open PRs #685/#686 overlap the generated +`dispatch-gate.om` and are retained in this stacked correction. + +## Defect and minimal correction + +`lock.om::lrm` returned zero on both negative and successful `unlink` results. Consequently +`lrel` always claimed success and the existing dispatcher pre-effect error check could +never observe a failed release. Return 41 for a negative result; retain zero on success. +This is source-confirmed, not a native runtime reproduction or exploit demonstration. + +Caller review: +- `lrel` directly forwards the result. +- `ltry` already maps a nonzero stale-lock removal result to 41; this branch is now reachable. +- `dispatch` checks the release before starting its effect and returns 78 on failure. +- Other dispatcher error cleanup and final-release sites ignore `lrel`; unchanged here. +- Existing lock-test initial best-effort cleanup ignores a missing-path error intentionally. + +This does not repair automatic stale-reclaim races, PID reuse, lock-file ownership, or +ignored cleanup/final-release failures. No production consumer cutover, compiler, ABI, +locking protocol redesign, or historical receipt change is included. + +## Regression and expected negative control + +The existing lock test retains all five checks, adds an explicit successful final release +check, creates a directory at the now-empty lock path, checks release returns 41, removes +that directory with `rmdir`, then checks missing-path release also returns 41. Directory +unlink is refused independently of permission/root status. Fixture creation/removal errors +exit 101/102. Use a disposable working directory with no active authority store, as with +the existing file/fork fixture; the suite is not safe against a live store. + +Expected fixed result: `lock checks=8 fails=0`, exit 0. Expected old-source control: +concatenate the base's `lock.om` with the new `lock-test.om`; it remains compilable without +new implementation symbols, but the two failed-unlink checks increment fails and main +returns 1 without a pass message. These are expectations, NOT observed runtime results. + +## Verification status + +- PASS: `git diff --check`. +- Qualification coordinator already compiles/runs the lock gate and checks child exit; + it has no hardcoded lock stdout count to change. +- PASS: lock gate equals lock + lock-test; dispatch gate equals action + store + lock + + dispatch + dispatch-test. No other authoritative source embedding of lrm exists. +- Source review: eight check calls; ordinary release0, failed release41; rmdir primitive + already used by seeded host directory tests; qualification coordinator observes exit. +- NOT_RUN: native compilation, fixed/old-source execution, existing dispatch and full + security gates, independent AArch64 replay. Editing host is x86_64; no bundled seed + executable ran and no toolchain was installed. + +Source checks are not functional qualification. Keep draft and preserve all required gates. diff --git a/seed/authority/README.md b/seed/authority/README.md index dbd20456a..c453b8098 100644 --- a/seed/authority/README.md +++ b/seed/authority/README.md @@ -14,7 +14,7 @@ dispatcher are the next phase; the C owner remains active until every consumer i | `store.om` | durable 32-word record and generation file: temp write, fsync, atomic rename, exact 256-byte read; torn/short files refused | | `dispatch.om` | persists in-flight, runs /bin/true and a static execpure effect, records performed/unknown, and marks unknown if the generation changes during the effect | | `lock.om` | cross-process O_EXCL pid lock with bounded retry and stale-pid reclaim; serializes read-check-persist, not the effect | -| `lock-test.om` | exclusive acquire, busy refusal, release, forked waiter and stale-pid reclaim | +| `lock-test.om` | exclusive acquire, busy refusal, release, forked waiter, stale-pid reclaim and failed-release reporting | | `*-test.om` | transition and store checks; no provider simulation | | `*-gate.om` | source + test concatenation for the current single-file compiler | @@ -43,7 +43,7 @@ Expected output and exit: | reuse | `reuse checks=074 000` | 0 | | store | `store checks=077 000` | 0 | | dispatch | `dispatch checks=037 000` | 0 | -| lock | `lock checks=5 fails=0` | 0 | +| lock | `lock checks=8 fails=0` | 0 | The authority gates and the standalone lock gate are run by `seed/qualification/security673/gate669.om` as part of the security qualification; the dispatcher @@ -132,6 +132,21 @@ exit 1. Store (77), dispatch (37), dispatcher-order (3) and lock (5) gates pass also lacked the already-existing `sgerr` generation-error interface; it now tests the current implementation rather than preserving that stale copy. +## Lock release errors + +`lrm`/`lrel` return 0 only when unlink succeeds, and 41 on unlink failure (including +an absent path). The lock gate checks ordinary release, directory refusal and +missing-path refusal. Its directory fixture is removed with `rmdir`; run gates +only in disposable test working directories, never against an active store. + +The pre-effect dispatcher release check returns 78 on this failure. Other dispatcher +cleanup and final-release sites still ignore the release result; this change does not +claim those paths report it, nor does it redesign stale-lock reclamation. + +Native run (2026-10-31, Linux AArch64, seed/out/omc 7a8b84fc): `lock checks=8 fails=0`, exit 0. +Negative control with `lock.om` from main 1db94162 (`lrm` returns 0 on unlink failure): no pass +line, exit 1 (the gate's failed-check exit; its setup errors exit 100..102). + ## Fixture source correction (2026-10-24) The dispatcher-order fixture now uses global/text names within the existing diff --git a/seed/authority/dispatch-gate.om b/seed/authority/dispatch-gate.om index 626d01707..a9a7acaed 100644 --- a/seed/authority/dispatch-gate.om +++ b/seed/authority/dispatch-gate.om @@ -399,7 +399,7 @@ end fn lrm to ulong r = unlink lpath 0 len lpath if lt r 0 -ret 0 +ret 41 end ret 0 end diff --git a/seed/authority/lock-gate.om b/seed/authority/lock-gate.om index 64f1e271d..abd580201 100644 --- a/seed/authority/lock-gate.om +++ b/seed/authority/lock-gate.om @@ -64,7 +64,7 @@ end fn lrm to ulong r = unlink lpath 0 len lpath if lt r 0 -ret 0 +ret 41 end ret 0 end @@ -114,8 +114,8 @@ fn lrel to ulong ret lrm end note SPDX-License-Identifier: AGPL-3.0-only -note Lock checks: exclusive acquire, busy refusal, release, a forked waiter, and stale-pid reclaim. -text passm "lock checks=5 fails=0\n" +note Lock checks: exclusive acquire, busy refusal, release, a forked waiter, stale-pid reclaim, and failed release. +text passm "lock checks=8 fails=0\n" global checks ulong 1 global fails ulong 1 global lbuf uchar 8 @@ -204,6 +204,22 @@ end u = ltry ulong getpid check u 0 u = lrel +check u 0 +note A directory cannot be unlinked as a regular file, even when run as root. +note Refuse a pre-existing fixture rather than replacing anything at this path. +r = makedir lpath 0 len lpath 448 +if ne r 0 +ret 101 +end +u = lrel +check u 41 +r = rmdir lpath 0 len lpath +if ne r 0 +ret 102 +end +note Missing-path removal is also a failure, not an idempotent success. +u = lrel +check u 41 if ne get fails 0 0 ret 1 end diff --git a/seed/authority/lock-test.om b/seed/authority/lock-test.om index 9733f31e6..641bbb81e 100644 --- a/seed/authority/lock-test.om +++ b/seed/authority/lock-test.om @@ -1,6 +1,6 @@ note SPDX-License-Identifier: AGPL-3.0-only -note Lock checks: exclusive acquire, busy refusal, release, a forked waiter, and stale-pid reclaim. -text passm "lock checks=5 fails=0\n" +note Lock checks: exclusive acquire, busy refusal, release, a forked waiter, stale-pid reclaim, and failed release. +text passm "lock checks=8 fails=0\n" global checks ulong 1 global fails ulong 1 global lbuf uchar 8 @@ -89,6 +89,22 @@ end u = ltry ulong getpid check u 0 u = lrel +check u 0 +note A directory cannot be unlinked as a regular file, even when run as root. +note Refuse a pre-existing fixture rather than replacing anything at this path. +r = makedir lpath 0 len lpath 448 +if ne r 0 +ret 101 +end +u = lrel +check u 41 +r = rmdir lpath 0 len lpath +if ne r 0 +ret 102 +end +note Missing-path removal is also a failure, not an idempotent success. +u = lrel +check u 41 if ne get fails 0 0 ret 1 end diff --git a/seed/authority/lock.om b/seed/authority/lock.om index bc3acb723..a0f868631 100644 --- a/seed/authority/lock.om +++ b/seed/authority/lock.om @@ -64,7 +64,7 @@ end fn lrm to ulong r = unlink lpath 0 len lpath if lt r 0 -ret 0 +ret 41 end ret 0 end