Skip to content

1bit-update --check: "up to date" is the unsigned list's word - say so, and draft the freeze RFC (engine#3448) - #3474

Merged
bong-water-water-bong merged 1 commit into
mainfrom
fix/3448-release-freeze-rfc
Nov 24, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
fix/3448-release-freeze-rfc

Conversation

@bong-water-water-bong

@bong-water-water-bong bong-water-water-bong commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #3448 (does not close it: the freeze half is an owner decision, not a code fix).

Rebased onto origin/main a95beca after #3465/#3466/#3467 merged; the line references below are that tree's, and the control/ctest/gate runs were re-done on the rebased branch (see Evidence).

What this is

Issue #3448 has two halves. The rollback half is fixed on main by #3454 (69bb03f): --latest reads the release identity from inside the verified image (1bit-update:812-819, update_identity_check :471-493) and refuses anything that is not the tag asked for and strictly newer. The freeze half is open: the "is there a newer release" decision still comes from GitHub's release list (update_pick, 1bit-update:257-302), which is not signed, and the first signature is checked at :453-455 — after that decision. Closing freeze needs a signed, expiring "latest per channel" statement; CONTRIBUTING.md makes that an RFC (anything touching security), not a code PR here.

So this PR does two things, and deliberately no third:

  1. Stops the updater claiming freshness it cannot prove. --check/--latest now say that an "up to date" answer is the release list's word (one note line), and distinguish "a running release ahead of the channel" from "the list has nothing newer" — both used to print a flat "up to date".
  2. Lands the RFC draft in docs/update-trust.md, in the style of the other security-relevant design records (docs/os-v3.md "In-system updates", .oss-scanner/threat_model.md): what the signature covers today, the exact order --latest decides in with file:line, what 1bit-update --latest: install only the release it asked for, newer than this one - read from the VERIFIED image (rollback protection, security) #3454 closed and what it leaves open, the freeze threat model, design options A–E with their trust assumptions and cost, the test plan and NOTICE impact.

The RFC is not implemented: no new file format, no new key, no new dependency, no signature scheme invented. The only code change is the reporting fix in (1).

What needs the owner (the RFC's first question)

Is a compromised release host (freeze) in the threat model?

The draft body for the RFCs Discussion is docs/update-trust.md; the open questions it ends with (pointer URL/TTL, fail-closed vs warn, replay-guard policy, signer role) are the decision surface.

The reporting fix, in detail

  • update_pick gains ahead= (1bit-update:291-295): the RUNNING release is strictly newer than the channel's newest (a final against its own -rcs, or a channel that has not caught up). It used to collapse into newer=no.
  • update_check answers that case up to date: running vX is newer than the CHANNEL's newest vY, keeps the plain up to date line for the same-tag case, and prints one note that the answer is the unsigned release list's word, so a host that hides a newer release is not detectable (1bit-update:328-336). --latest does the same before its early exit (:430-438).
  • docs/os-v3.md: a paragraph after the trust order says what the order does not prove (freeze) and points at the draft.
  • tests/update_check_test.sh: two new arms (the ahead wording, the note); the existing "a final sorts after its own release candidates" arm now asserts the ahead wording, which is what the tool says there now. os/mini/release-check.sh --self-test gains the same board output as a PASS fixture, so the update-check row still recognises the answer.

Evidence

Control (new test against the pre-fix updater from origin/main a95beca):

$ c=~/.cache/scratch-3448/control; mkdir -p $c/tests $c/os/v3/puppy/embed/usr/local/bin
$ git show origin/main:os/v3/puppy/embed/usr/local/bin/1bit-update > $c/os/v3/puppy/embed/usr/local/bin/1bit-update
$ cp tests/update_check_test.sh $c/tests/
$ (cd $c && sh tests/update_check_test.sh)
...
FAIL a final release sorts after its own release candidates (v2026.49 > v2026.49-rc1)
FAIL a running release newer than the channel's newest is said as ahead, not as a flat 'up to date'
FAIL the up-to-date answer names the unsigned release list it rests on, and what that cannot detect
update_check_test: FAIL

Branch:

$ sh tests/update_check_test.sh
... 12 x ok ...
update_check_test: ok

Sanity: the same control tree with origin/main's own test and updater → update_check_test: ok (only the arms this change adds or re-words differ).

ctest rows (cmake -B build ... then the row subset; no target build is needed for these rows):

$ ctest --test-dir build -R 'update|release_check_selftest|release_sign' --output-on-failure --timeout 600
release_check_selftest Passed, one_bit_update_slots Passed, release_sign Passed, release_sign_self Passed,
update_shadow Passed, update_check Passed, update_latest Passed, update_workdir Passed, update_identity Passed,
update_notice Passed, console_update Passed; update_e2e_loop Skipped (needs root/loop, unchanged)
100% tests passed, 0 tests failed out of 12

Gate:

$ scripts/pre-pr-checks.sh --tree-only --base origin/main
...
pre-pr-checks: all 15 check(s) green, 3 skipped, 0 could not be told, 2 open-PR row(s) not run (--tree-only)

Skips: submodule_pin (0 submodules initialised in this branch worktree), hip_f16_audit and kernel_id_selftest (no gpu-kernels tree; $GPU_KERNELS_DIR unset).

What I could not verify

  • The freeze itself is not reproduced or closed. It needs control of the release host / GitHub API; there is no test asserting it is closed because it is not. The issue says "not exploited or tested on hardware"; I did not build a hostile release host either.
  • The release workflow that writes SHA256SUMS.sig is not in this tree (this repo ships tools/release_sign.py and bakes /etc/1bit/release-pub via os/v3/puppy/cut.sh). The RFC's cost line for "one signing step beside it" is reasoned from that boundary, not measured.
  • No hardware run: the change is shell/docs only; the ctest rows and the gate above are the evidence.

Review risk to look at first

The wording change is the only behaviour change: anything that greps --check output should still find the plain up to date line for the same-tag case (console, notice and update_check_verdict all keep working; the new ahead line and note are additions). The RFC draft's recommendation (A) and its expiry/replay-guard policy are a proposal for the owner, not a decision this PR makes.

…o, and draft the freeze RFC (engine#3448)

Security review (cl-flm lane, 24 Nov). Issue #3448 has two halves. The rollback half is fixed by #3454
(69bb03f): --latest reads the release identity from inside the verified image and refuses anything that
is not the tag asked for and strictly newer. The freeze half is open, and it is a release-trust decision
(CONTRIBUTING.md: anything touching security is an RFC), so this commit does NOT invent a fix for it: it
stops the tool from claiming the freshness it cannot prove, and puts the decision on record.

Rebased onto origin/main a95beca (after #3465/#3466/#3467); the line references below are that tree's.

The mechanism, as it stands (os/v3/puppy/embed/usr/local/bin/1bit-update):
- update_pick decides which release is the channel's newest and whether it is newer than the running one,
  from GitHub's release list (:257-302). That list is not signed; the first signature is checked at
  :453-455, after the "is it newer" decision, and the early exit says "up to date" without checking any
  signature (:430-438). So a release host that keeps serving the current release also keeps the machine
  answering "up to date" (freeze).

What changed:
- update_pick prints ahead=yes when the RUNNING release is newer than the channel's newest (a final against
  its own -rcs, or a channel that has not caught up), which used to be folded into newer=no (:291-295).
- update_check and update_latest answer that case "up to date: running X is newer than the CHANNEL's newest
  Y" and print one note that the answer is the unsigned release list's word, so a host that hides a newer
  release is not detectable (:328-336, :430-438). A plain "up to date" line is kept for the same-tag case,
  so the console, the notice and the board rows keep reading it.
- docs/update-trust.md (new): what the signature covers today (tools/release_sign.py), the exact order
  --latest decides in with file:line, what #3454 closed and what it leaves open, the freeze threat model
  (adversaries, in/out of scope, P1-P3), and the draft RFC body: options A (signed, expiring latest per
  channel reusing release_sign.py), B (TUF-style metadata), C (signed tag -> commit), D (tag+channel in the
  signed SHA256SUMS), E (accept the risk), each with its trust assumptions and cost, the test plan and the
  NOTICE impact, and the open owner questions.
- docs/os-v3.md, "In-system updates": a paragraph after the trust order saying what the order does not
  prove - freeze, with the release-list/commit/rollback facts - and pointing at the draft.
- tests/update_check_test.sh: two arms (the ahead wording, the note), and the existing "a final release
  sorts after its own release candidates" arm now asserts the ahead wording, which is what the tool says
  there now. os/mini/release-check.sh --self-test gains that same output as a PASS fixture, so the
  update-check row still recognises the answer on the board.

What remains open, and is the RFC's first question: is a compromised release host (freeze) in the threat
model? If yes, option A is the recommendation; if no, record that in docs/os-v3.md and close #3448. No code
in this commit closes it - the honest wording says exactly that.

Evidence:
- Control (new test, PRE-FIX updater from origin/main a95beca):
    c=~/.cache/scratch-3448/control; mkdir -p $c/tests $c/os/v3/puppy/embed/usr/local/bin
    git show origin/main:os/v3/puppy/embed/usr/local/bin/1bit-update > $c/os/v3/puppy/embed/usr/local/bin/1bit-update
    cp tests/update_check_test.sh $c/tests/
    (cd $c && sh tests/update_check_test.sh)
  FAIL a final release sorts after its own release candidates (v2026.49 > v2026.49-rc1)
  FAIL a running release newer than the channel's newest is said as ahead, not as a flat 'up to date'
  FAIL the up-to-date answer names the unsigned release list it rests on, and what that cannot detect
  update_check_test: FAIL
- Branch: sh tests/update_check_test.sh -> "update_check_test: ok" (12 arms).
- Sanity: the same control tree with origin/main's own test and updater -> "update_check_test: ok" (only the
  arms this change adds or re-words differ).
- ctest --test-dir build -R 'update|release_check_selftest|release_sign' --output-on-failure --timeout 600:
  "100% tests passed, 0 tests failed out of 12" (update_e2e_loop skipped: needs root/loop, unchanged).
- scripts/pre-pr-checks.sh --tree-only --base origin/main:
  "pre-pr-checks: all 15 check(s) green, 3 skipped, 0 could not be told, 2 open-PR row(s) not run
  (--tree-only)"; skips: submodule_pin (0 submodules initialised), hip_f16_audit and kernel_id_selftest
  (no gpu-kernels tree).

Refs #3448.
@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) November 24, 2026 08:22
@bong-water-water-bong
bong-water-water-bong merged commit fa0c877 into main Nov 24, 2026
10 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the fix/3448-release-freeze-rfc branch November 24, 2026 08:34
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3448 - Partially compliant

Compliant requirements:

Non-compliant requirements:

  • Signed "latest" pointer per channel with expiry (freeze half) not implemented yet

Requires further human verification:

  • Whether the freeze threat model is in scope (owner decision)
  • Where the pointer lives (repository branch / fixed-name release / 1bit.gg)
  • What TTL the pointer should have
  • Fail closed or warn behavior for freshness proof failure
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Clarity on "up to date" message

The updated "up to date" messages now distinguish between cases where the running release is newer than the channel's newest (which is a valid case) versus when the release list simply has nothing newer. This is important because the former case should not be treated the same as the latter, which can be misleading. The new messages correctly reflect this distinction, but the previous flat "up to date" message was ambiguous.

no)  if [ "$(_v ahead)" = yes ]; then
         say "up to date: running ${_run} is newer than the $_ch channel's newest $(_v tag)"
     else
         say "up to date"
     fi
     # "up to date" is what GITHUB'S RELEASE LIST says, and that list is not signed: a release host that keeps
     # serving the current release makes an older one newest. The whole statement of what that leaves open, and the
     # design options, are docs/update-trust.md (engine#3448).
     say "note: the release list is not signed, so a host that hides a newer release is not detectable (engine#3448)" ;;
Ahead flag usage

The introduction of the ahead= flag in update_pick correctly separates the case where the running release is newer than the channel's newest from the case where the release list has nothing newer. This change ensures that the tool can distinguish between these two different scenarios and provide more accurate feedback to the user.

# ahead=: the RUNNING release is newer than the newest release of the channel - a final against its own -rcs, or a
# channel that has not caught up. Folding it into newer=no printed "up to date" for a case where the list held nothing to
# compare against, and the two answers are not the same statement: see the note --check prints (engine#3448).
print("ahead=" + ("unknown" if cur is None else ("yes" if best[0] < cur else "no")))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1bit-update --latest: 'newer' comes from the unsigned release tag (rollback/freeze); bind tag+channel into the signed SHA256SUMS

1 participant