Repository navigation
fix(shell): tolerate unrelated nsfs mountinfo entries in the private kernel check - #5734
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Mountinfo validation and test coverage internal/shellinstaller/user_runtime_primitives_linux.go, internal/shellinstaller/user_runtime_primitives_linux_test.go |
privateCgroupPath checks the mountpoint before parsing the root. Unrelated mount roots no longer prevent cgroup mapping, while the /sys/fs/cgroup root must remain canonical. Tests cover unrelated mount roots and a noncanonical mountpoint. |
Priority:
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
- Issue 5733 reports that an unrelated
nsfsmount root causes the private installation launch probe to fail. This change allows unrelated mount roots while retaining validation for the cgroup mount.
Suggested reviewers: alan-thegentleman
Merge Risk: 
Minimal · up to 5a3a9
-
The change correctly addresses unrelated mountinfo roots without weakening validation of the trusted cgroup mount.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
The PR addresses the coding requirements in
#5733.privateCgroupPathvalidates the root field only for/sys/fs/cgroup, while it still validates mountpoints on every line. The trusted cgroup2 line retains canonical-root checks.TestPrivateCgroupMappingcovers unrelatednsfs, unrelated noncanonical roots, and unrelated noncanonical mountpoints. The supplied PR evidence reports passing automated checks.
-
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
CI triage for the two
|
🔗 Linked Issue
Closes #5733
🏷️ PR Type
What kind of change does this PR introduce?
type:bug— Bug fix (non-breaking change that fixes an issue)type:feature— New feature (non-breaking change that adds functionality)type:docs— Documentation onlytype:refactor— Code refactoring (no functional changes)type:chore— Build, CI, or tooling changestype:breaking-change— Breaking change (fix or feature that changes existing behavior)📝 Summary
/proc/self/mountinfoline and required both root and mountpoint to be canonical absolute paths. On stock Ubuntu GNOME desktops,snapd-desktop-integrationalways contributes an nsfs mount whose root field is a namespace identifier (mnt:[4026532518]), so every private gentle-shell installation from the TUI failed asuncertainat step 5/5 (bug(shell): private install launch probe fails on every stock Ubuntu desktop — mountinfo parser rejects snapd nsfs mounts ("mnt:[...] is not canonical") #5733).📂 Changes
internal/shellinstaller/user_runtime_primitives_linux.goprivateCgroupPathvalidates the root field only on the trusted cgroup2 mount line; unrelated lines classify by mountpoint onlyinternal/shellinstaller/user_runtime_primitives_linux_test.go🤖 AI Assistance
Select exactly one option. Do not check both options.
Tool/model (if known): GLM 5.3 (pi coding agent)
Material scope: Diagnosis of the mountinfo refusal against a user report; implementation of the parser relaxation and its test cases in
internal/shellinstaller; red/green verification via a temporary uncommitted harness callingprivateCgroupPathdirectly.Verification performed: Red reproduction of the exact
mnt:[4026532518]refusal before the fix; green after it with shadow/duplicate and noncanonical trusted-line refusals preserved;go test ./...,go run ./internal/gofmtcheck,go vet ./internal/shellinstallerandgo build ./...all pass locally.Trivial formatting, spelling, minor autocomplete, search/navigation, and trivial, non-substantive mechanical transformations do not need to be itemized. See AI_POLICY.md for the canonical policy.
🧪 Test Plan
Unit Tests
go test ./...Go Format
E2E Tests (Docker required)
Benchmark Validation
See the benchmark guide. Benchmark validation applies to review-lifecycle, gates, recovery, delivery, benchmark implementation/corpus/classifier, and benchmark-claim changes. For unrelated changes, explain
N/Ain the Test Plan.go test ./...)go run ./internal/gofmtcheck)cd e2e && ./docker-test.sh) — validated by the CIe2e-dockerjob; local Docker is unavailable in this environment, and the new Guest-mode cases (TestPrivateCgroupMapping) run in the boundedshell-linux-first-cicontainerprivateCgroupPathwith the snapd nsfs line and noncanonical variants before committingBenchmark validation: N/A — no benchmark, review-lifecycle, gate, or delivery changes.
🤖 Automated Checks
The following checks run automatically on this PR:
additions + deletions) or usesize:exceptionstatus:approvedtype:*Labeltype:*label must be appliedgo test ./...must passgo run ./internal/gofmtcheckmust passcd e2e && ./docker-test.shmust pass✅ Contributor Checklist
status:approvedsize:exceptionauthority (current direct human instruction for the exact target/action, verified actorMAINTAIN/ADMIN, human choice and documented rationale) and observed readback are recordedtype:*label; any mutation followed the canonical issue-creation contract and reviewed CONTRIBUTING.md catalog (existing types preserved; conflicts deferred to the human)go test ./...)go run ./internal/gofmtcheck)cd e2e && ./docker-test.sh)docs/are updated in the same PR (reference docs trackmain)Co-Authored-BytrailersSummary by CodeRabbit