Repository navigation
Sign-out: an absent candidate behind a read-only mount is retired; a real survivor backs off - #245
Merged
Merged
Conversation
…d a real survivor backs off On webOS 4.10.2 every sign-out left the clear "incomplete" forever: the 0.6-era candidate /media/internal/.<app>-auth.json does not exist, but the jail sees that mount read-only, and Linux answers unlink with EROFS from the parent's mount before it looks the child up. The neutralize fallback then said ENOENT, and retire_session_candidate still reported failure, so the adapter re-ran the whole clear (marker rewrite, fsync, two log lines) every second. Because credential commits wait behind a pending erase, a sign-in after that sign-out was never persisted, and "Delete all local data" (same queue) never reached its sweep or its route back to sign-in. Retirement now means "no credential remains at the path": removed, neutralized, or proven absent. A refused unlink is followed by a no-follow lookup (storage::prove_absent_after_refused_unlink, the rule telemetry's remove_file_or_prove_absent already used), and a neutralize open answering ENOENT is the same proof. The revocation-marker removal uses the same rule. A name that exists, or cannot be looked at, stays a failure. A clear that leaves a real credential is never abandoned — the erase stays queued and the revocation is retained — but its retries now back off 1 s, 2 s, 4 s … capped at 30 s instead of running every second for the life of the process. storage::unlink is the one unlink for credential cleanup, with a test-only, directory-scoped errno seam so the host suite can reproduce the device's EROFS on the storage worker too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Sep 25, 2026
GLinnik21
added a commit
that referenced
this pull request
Sep 25, 2026
* v0.7.0 audit: fourth device pass verifies #245 and #246 The fourth device pass (2026-09-25, debug builds of 8dcb7f7 and 033746b, the maintainer's own account with only the Guest profile seated) verified both fixes for the read-only /media/internal mount: sign-out no longer retries an absent legacy candidate forever and a sign-in after it persists (#245), and Delete all local data no longer reports absent files as leftovers (#246). The audit records the pass as a by-hand evidence row, closes the third pass's "fix in flight" finding, drops the sign-out retry loop from Known issues, and adds #245 and #246 to the landed-after section. Neither changes a persisted format, which the diffs confirm: they change only when a file counts as removed and how often a failed clear is retried. The release note needed no change: neither defect shipped in a stable release, and nothing it says about Sign out or Delete all local data became false. Screenshots were regenerated with SHOT_CHECK=1; no figure changed beyond JPEG re-encode noise, so none are committed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * v0.7.0 audit: scope the #241 docs-only claim; the ledger's sign-out finding is fixed The host/static row's "every commit after b99e79f touches only docs" was true of the #241 branch it was written on, not of main, where #245 and #246 later changed shipped code; the row now says so and points at their own CI and the fourth pass. The forward-port ledger's third-pass row still called the sign-out retry loop a fix in flight; it now records #245 and the device verification. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Observed (webOS 4.10.2, debug install of 676e5ce)
After signing out, the event log repeated this pair about once a second, with no end:
The file does not exist. The DB8 record went to Cleared.
Root cause
session::clear()callsretire_session_candidateon every legacy candidate, whether or not it exists. The jail sees/media/internalas read-only, and Linux checks the parent mount for write access before it looks the child up, sounlinkreturns EROFS for a name that is not there. The neutralize fallback opens withoutO_CREATand got ENOENT, which proves the name is absent. The function still returned failure. That madeClearOutcome::Durable { legacy_swept: false }, andSessionAdapter::take_erasedre-ran the whole clear everySTORAGE_RETRY_MS(1 s), forever. Every run rewrote and fsynced the revocation marker and logged two lines.This had more consequences than log spam, because other work waits behind a pending erase:
submit_commitreturns early whileerasuresis non-empty. The old erase could not wipe or revoke the new sign-in, since it runs strictly before any queued commit and a completed erase is never retried. But the new credential was never written, so the next launch needed a new sign-in.SessionCmd::EraseLocal(all_local = true) uses the same queue.delete_all_local_dataand theLocalDataErasedroute back to sign-in only run fromfinish_erase, and the stuck clear never got there.Telemetry's cleanup already handled this case through
storage::remove_file_or_prove_absent. The session sweep had never been moved onto it.Fix
storage::prove_absent_after_refused_unlinksharesclassify_remove_errorwith telemetry's helper. A neutralize open that answers ENOENT counts as the same proof. An unlink that itself answers ENOENT still syncs the parent, because that can be the retry of an earlier unlink whose sync failed. A name that exists, or that cannot be looked up, is still a failure.retire_session_candidategets the rule:clear()'s sweep,persistence::cleanup_after_confirmed_clear,retire_marked_fallbacks_lockedandretire_other_fallback_candidates_locked. It also covers the revocation-marker removal inretry_pending_revocation_removals_locked, which had the same EROFS-on-absent loop.ERASE_RETRY_CAP_MS), instead of every second for the life of the process.storage::unlinkis now the single unlink for credential cleanup. It has a test-only errno seam scoped to one directory and applied process-wide, so the host suite can reproduce the device's EROFS, including on the storage worker.Evidence
The same EROFS fault drives every test. These were watched RED with the retirement fix reverted, then GREEN with it back:
signout_counts_an_absent_candidate_behind_a_read_only_mount_as_retired(TV pair: unlink EROFS, neutralize ENOENT)revocation_marker_absent_behind_a_read_only_mount_is_retiredretry_pending_revocation_removals_locked()a_signin_after_signout_behind_a_read_only_mount_is_written(adapter)delete_all_local_data_behind_a_read_only_mount_reaches_its_sweep(adapter)These tests guard real failures:
signout_keeps_reporting_a_present_candidate_behind_a_read_only_mount: the file exists, unlink returns EROFS, neutralize is refused. The clear stays incomplete on every attempt, the credential bytes survive, the marker is retained, and the process stays revoked. A later retry retires it.a_clear_that_leaves_a_credential_retries_with_capped_backoff_and_never_gives_up(adapter): observed waits are[1000, 2000, 4000, 8000, 16000, 30000, 30000]ms. The erase stays queued throughout and completes on the next due retry once the file can go.erase_retry_delay_doubles_to_its_capGates (committed tree ab86f4e, clean before and after)
make check: exit 0test result: ok. 4413 passed; 0 failed; 2 ignored; 0 measured; 0 filtered outtest result: ok. 4469 passed; 0 failed; 2 ignored; 0 measured; 0 filtered outtest result: ok. 101 passed; 0 failed; 0 ignored; 0 measured; 0 filtered outCARGO_INCREMENTAL=0 cargo +nightly check --manifest-path rust-modules/Cargo.toml --lib --no-default-features: exit 0make(ARM): exit 0Adversarial review: approve, no material findings.
Not device-verified. It needs a TV retest: sign out, then confirm the log shows neither line repeating.
🤖 Generated with Claude Code