fix(guestos): allow systemd-resolved to connect to networkd's resolve-hook socket - #11413
Merged
Merged
Conversation
…-hook socket systemd-resolved connects to systemd-networkd's varlink resolve-hook socket (/run/systemd/resolve.hook/io.systemd.Network) to obtain per-link DNS configuration. Our policy denies that connectto, so an enforced AVC denial fires on every GuestOS boot; usually resolved still recovers, but nondeterministically it is left without any DNS servers for the lifetime of the boot, with every lookup failing with 'Failed to start query: Permission denied'. This broke DNS for the whole life of an unassigned node in a run of upgrade_downgrade_unassigned_nodes_test_head_nns on 2026-08-28, making all 58 attempts of the orchestrator to download the elected GuestOS upgrade image fail within ~2ms each, and timing out the test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The rule directly addresses the observed SELinux denial with an appropriately scoped permission.
Pull request overview
Allows systemd-resolved to retrieve per-link DNS configuration from systemd-networkd.
Changes:
- Grants the required SELinux
connecttopermission. - Documents the DNS failure caused by the denial.
File summaries
| File | Description |
|---|---|
ic-os/components/guestos/selinux/systemd-fixes/systemd-fixes.te |
Adds the targeted socket permission. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Bownairo
approved these changes
Sep 2, 2026
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.
Why
While root-causing a flake of
//rs/tests/consensus/upgrade:upgrade_downgrade_unassigned_nodes_test_head_nns(2026-08-28 17:40 UTC), the unassigned GuestOS node turned out to have no working DNS for its entire ~11-minute life:Failed to start query: Permission deniedfrom systemd-resolved — every DNS lookup failed;error sending request), zero bytes ever fetched, and the test timed out.systemd-resolved connects to systemd-networkd's varlink "resolve hook" socket (
/run/systemd/resolve.hook/io.systemd.Network) to obtain per-link DNS configuration. Our policy does not allow thatconnectto, so the denial fires on every boot (a singleFailed to connect to resolve.hook: Permission deniedappears in healthy boots too). Usually resolved still ends up with working DNS through other paths; nondeterministically — as in this run — it does not recover and the node is left without name resolution, with no self-healing for the rest of the boot. SSH/IP-based connectivity keeps working, which is why the node looks healthy to the test driver while every DNS-dependent operation (such as upgrade-image downloads) is dead.Fix
Allow the connection in the
systemd-fixespolicy module:(The sock-file write permission is evidently already granted — the denial fires on the final
connecttocheck.)Validation
bazel build //ic-os/guestos/envs/dev:rootfs-tree.tar— pass (this is the action that compiles the SELinux policy modules via the refpolicy devel Makefile, so it validates the new rule);//ic-os/components:check_unused_components_test— pass. (dev_component_file_references_testfails identically on unmodified master on this machine — a localUnicodeDecodeErrorreading theopen_rootfs_devbinary — so it is left to CI.)Found while root-causing the
//rs/tests/consensus/upgrade:...flakiness following.claude/skills/fix-flaky-tests/SKILL.md. The tightened driver/bazel timeouts for the affected test are in #11412.🤖 Generated with Claude Code