Repository navigation
fix(countme): read the booted image ref without running bootc (utah#1198) - #1708
Conversation
projectbluefin-countme ran `bootc status --json` from an unconfined service. bootc's SELinux probe (chcon to a test label) was denied mac_admin, logging two AVC denials on every boot (projectbluefin/utah#1198). Read the ref from the booted deployment's .origin file (found through ostree= on the kernel command line), falling back to the boot-time snapshot /run/ublue-os/booted-image. Non-bootc hosts keep their image-tag fallback. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7tJ5iop2b4GMkKSPAv Signed-off-by: Danathar <Danathar@users.noreply.github.com>
Follow the composefs=/composefs.digest= command-line arguments to /sysroot/state/deploy/<id>/<id>.origin, the same lookup utah#1220 uses, and avoid a stray error when the snapshot file is missing. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7tJ5iop2b4GMkKSPAv Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: castrojo The full list of commands accepted by this bot can be found here. Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Looks correct to me for the ostree path. One open question on the composefs path. The red E2E check is not caused by this change.
Code. booted_ref() in system_files/shared/usr/libexec/projectbluefin-countme:36-65 no longer runs bootc. Here is how each piece works:
- ostree path.
ostree=from/proc/cmdlinegoes throughreadlink -fand then gets.originappended. On a booted host,/ostree/boot.N/<stateroot>/<csum>/<serial>resolves to…/deploy/<csum>.<serial>, and the.originkeyfile sits beside it. - Transport stripping. The strips at lines 53-58 use shortest-prefix
#matches, soostree-remote-registry:<remote>:andostree-remote-image:<remote>:docker://both reduce to a bare ref. The new transport-form test covers all five forms. - Stream parsing. The stream is still taken from
${ref##*:}after stripping@digest. A registry port such aslocalhost:5000/dakotacomes out asunknown, and a test covers it. - Sandbox. The service still runs as root under
ProtectSystem=strict, which leaves/sysrootreadable. The unit comment change atprojectbluefin-countme.service:25-26matches the new behavior. - No-ref case. The no-ref branch for Server/live ISO (lines 74-87) is unchanged, so Server DDI reporting is unaffected.
- Test guard. The
bootcstub now leaves a marker thatteardownchecks for. Every test therefore asserts that the script never runs bootc, which is the regression guard utah#1198 needs.
Open question (not verified). Line 45 reads ${COUNTME_SYSROOT:-/sysroot}/state/deploy/$id/$id.origin on composefs hosts, citing utah's ublue-booted-image-sync. That script's source is in neither this repo nor projectbluefin/utah, so I could not confirm that the path or the container-image-reference key matches bootc's composefs backend. The fallback to /run/ublue-os/booted-image (lines 60-63) limits the damage. If the path is wrong, composefs Utah hosts are still counted when that snapshot exists, and they skip silently when it doesn't. Someone with a composefs VM can confirm with cat /sysroot/state/deploy/*/*.origin.
E2E attribution. This run (44372598326) has 6 failing scenarios:
common_dconf.feature:91,common_desktop_entries.feature:12and:24also fail on #1709, which shares none of this diff.common_portals.feature:25,:29andportal_integration.feature:10are the uwelcome portal stall that #1709 fixes. They pass on #1709's run.
None of the 6 touches countme.
Confidence: 5/5 (safe)
— hive: agent=reviewer-2 backend=claude model=claude-opus-5-5 effort=medium claude=2.1.326
|
E2E GNOME-common failure is not caused by this PR. Failing scenarios (dconf Searchlight, desktop entries, xdg-desktop-portal / portal_integration) are unrelated to countme and fail identically on other heads: #1690 run 44372663960 (same 3 base failures), merge-queue runs 44359456291 and 44359291950 (same 12). This PR only touches projectbluefin-countme files and tests/test_projectbluefin_countme.bats, whose bats test and validate jobs pass. The countme opt-out marker took effect in the VM (service skipped on ConditionPathExists). No code change pushed. Needs the shared baseline E2E regression fixed on main, or a rerun after that. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-sonnet-5.5 copilot=1.0.88 |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. stage 060-reviewed → 050-review-pending: repo-auto-merge-disabled |
juanresendiz813
left a comment
There was a problem hiding this comment.
Ran the script against a real composefs-booted Dakota's cmdline and .origin and it reports dakota/main:stable, path layout matches bootc. One small thing: the insecure composefs=? form keeps the '?', so it looks for the wrong .origin and only works if /run/ublue-os/booted-image exists. id=${id#?} after the case fixes it. Low impact today. FYI utah#1198 itself was already closed by utah#1279 (SELinux rule), but this is still a nicer fix.
castrojo
left a comment
There was a problem hiding this comment.
Second ack. Correct root cause: the service no longer runs bootc at all, so the unconfined_service_t SELinux probe's mac_admin denials (utah#1198) are avoided. booted_ref reads the booted deployment .origin via ostree=/composefs= cmdline (falling back to /run/ublue-os/booted-image); transport-prefix stripping and the registry-port guard are each covered by new tests, and the bootc stub now asserts non-invocation in teardown.
Supersedes #1689 (adopted after CI went red and the contributor was unavailable; original commits by @Danathar preserved).
This branch is #1689's head
9460399a87e7as pushed by @Danathar (forkprojectbluefin/common), unchanged. Last lane reason on the original:optional-check-failing:E2E — composed common suite / e2e / GNOME — common.Hive fix agent: rebase this branch on
main, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and theirSigned-off-by; add your own sign-off on your commits. Do not open another PR.