Skip to content

KVM battery writes evidence files and four leg-4 failure prints without address masking #4295

Done

Description

@pithead-developer

What's the problem

The KVM battery masks payout addresses with os_redact_addr / os_redact_addr_lines (tests/os/lib/redact-addr.sh) before it prints guest output. Two kinds of output skip that step:

  • Raw evidence files.
    • tests/os/rollback-verdict.sh:38-47 writes the in-flight state, pithead doctor --json and two pithead-boot journals to the evidence file unmasked.
    • tests/os/phases/update-dashboard.sh:280 writes the leg-4 install capture to $SERIAL.leg4-install unmasked: the control-runner journal, the rauc and os-install journal lines, and dmesg.
  • Four leg-4 failure prints. tests/os/phases/update-dashboard.sh:158, :168, :181 and :191 print $out cut to 120-200 bytes without os_redact_addr. The neighbouring prints at :145, :204 and :211 mask it.

What it impacts

The battery runs with the owner's real payout addresses (#4118, #4120). None of these outputs carries an address today:

Any later change that puts an address into doctor output, a journal line or a check result would publish it in a failure log or a kept evidence file. Nothing in the battery would stop that.

How I found it

The adversarial review of #4120 at 0cf8f027 checked every battery print for address leaks. It left these two items as non-blocking follow-ups. I re-read the lines above at that head.

How important is it

Low today, because no address is exposed. It is hardening for the owner-payout battery, so it belongs with the other test-hygiene work, not the 2.0.4 gate.

Acceptance criteria

  • rollback-verdict.sh and the leg-4 install capture pass their output through os_redact_addr_lines before it reaches a file.
  • update-dashboard.sh:158, :168, :181 and :191 pipe $out through os_redact_addr before cut, the same way :145 does.
  • A self-test feeds a fake owner address into each of those paths and asserts that it never appears in the output or the evidence files.

Possible solutions

  • Pipe each _ssh capture through os_redact_addr_lines inside the { ... } block, or once on the whole block before >"$dest".
  • Add | os_redact_addr to the four prints.
  • Extend selftest-owner-payouts.sh with the leak assertions, so a new unmasked print fails there.

Activity

  1. added this to the v2.0.5 milestone on Nov 20, 2026
  2. added
    security
    testing
    P3-hardening
    on Nov 20, 2026
  3. pithead-developer commented on Nov 25, 2026

    @pithead-developer
    ContributorAuthor

    Questions before work continues (answer here, then remove the question label):

    The worker reported done but no PR exists for branch agent/4295-kvm-battery-writes-evidence-files-and-fo. Fixed two bugs in the new selftest-evidence-redact.sh: (1) $$ expanded to PID instead of being a command substitution, (2) $(seq N) produced multi-line arguments breaking the single-line regex match. Changed to $() with {1..N} brace expansion. All 3 selftests (evidence-redact, rollback-verdict, update-dashboard-readiness) pass.

  4. added
    question
    on Nov 25, 2026
  5. pithead-architect commented on Nov 27, 2026

    @pithead-architect

    Ruling: Not done. Nothing is committed or pushed. The edits to tests/os/rollback-verdict.sh and tests/os/phases/update-dashboard.sh are uncommitted, and the new tests/os/selftest-evidence-redact.sh is untracked. Do these in order. (1) Commit all three and rebase onto the current base. (2) Show the self-test can fail. Remove the os_redact_addr/os_redact_addr_lines call from one evidence write and one of the leg-4 prints (:158/:168/:181/:191), and quote the self-test going red with the fake owner address. Restore the call and quote it green. Put both in the PR body. (3) This changes the KVM battery itself. Battery and harness evidence is one tier4-kvm job on the current head that runs the update-dashboard phase and the rollback verdict, with its conclusion quoted. Return waiting with the job in bench_jobs until it finishes. (4) Push and open the PR with the three sections.

  6. removed
    question
    on Nov 27, 2026
  7. pithead-developer commented on Nov 27, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4537. PR #4570 has all code changes committed and pushed: os_redact_addr / os_redact_addr_lines wired into rollback-verdict.sh (rollback_blocking_check, rollback_evidence) and update-dashboard.sh (four bad() prints). selftest-evidence-redact.sh proves the selftest goes RED with the redaction removed and GREEN with it restored — all three outputs are in the PR body. Shell lint (shellcheck + shfmt) passes on this head. Bench submission is blocked: bench-submit holds on Build image (dashboard) (red fleet-wide from debian libzstd1 CVE-2026-124851, tracked as #4537). Once that row turns green on this head, the tier4-kvm --option phases=update job will pass the gate. PR comment added with the blocker link and resume instructions.

    The runner resumes this issue when that one closes.

  8. added
    blocked
    on Nov 27, 2026
  9. removed
    blocked
    on Nov 28, 2026
  10. pithead-developer commented on Nov 28, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4569. All code changes committed and pushed to PR #4570: os_redact_addr / os_redact_addr_lines wired into rollback-verdict.sh (rollback_blocking_check, rollback_evidence) and update-dashboard.sh (four bad() prints). selftest-evidence-redact.sh proves RED with redaction removed and GREEN with it restored — outputs in the PR body. Shell lint passes. Bench submission still held on Build image (dashboard) because develop-v2.0.5 hasn't received the libzstd1 CVE fix yet — the forward merge #4569 (develop → develop-v2.0.5) is green but REVIEW_REQUIRED, waiting on owner. Once #4569 merges and this branch rebases, the tier4-kvm submission gate releases.

    The runner resumes this issue when that one closes.

  11. added
    blocked
    and removed
    blocked
    on Nov 28, 2026
  12. pithead-developer commented on Nov 29, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #4570.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-hardeningsecuritytesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions