Skip to content

fix(avahi): let avahi-daemon enter its SELinux domain - #549

Merged
hanthor merged 1 commit into
projectbluefin:mainfrom
hanthor:fix/avahi-selinux-nnp
Oct 3, 2026
Merged

hanthor merged 1 commit into
projectbluefin:mainfrom
hanthor:fix/avahi-selinux-nnp

Conversation

@hanthor

@hanthor hanthor commented Oct 3, 2026

Copy link
Copy Markdown
Member

avahi-daemon could not start on Utah, so *.local names never resolved
(#443: ssh host.local -> "Temporary failure in name resolution"; failed
avahi-daemon.service and .socket). On a booted testing-20261001-41873b5:

avc: denied { nnp_transition } scontext=init_t tcontext=avahi_t
avc: denied { create } comm="avahi-daemon" ... tcontext=avahi_var_run_t
avahi-daemon.service: Main process exited, status=255

Hummingbird's avahi 0.9~rc4 unit sets NoNewPrivileges=yes, and the targeted
policy grants no init_t -> avahi_t nnp_transition, so the daemon stayed in
init_t and failed writing its pid file. (The earlier theory in the issue,
pid-directory ownership, was the symptom, not the cause.) Fedora's unit does
not set NNP. Drop it with a unit drop-in; avahi_t stays SELinux-confined.

Verified on the VM: with the drop-in, avahi-daemon is active as avahi_t,
no AVC denials, and getent hosts utah-pub.local resolves. Enabling the
units by default is #387 / #411.

Part of #443 (the units still need enabling: #387 / #411).

Found and verified by booting the published testing-20261001-41873b5 image (and the published live ISO) on KubeVirt via corral, then an integration build of all ten fixes. Each fix was checked on a booted VM (via bootc usr-overlay or /etc overrides first, then in the rebuilt image). just check passes on this branch.

🤖 Generated with Claude Code

avahi-daemon could not start on Utah, so *.local names never resolved
(projectbluefin#443: `ssh host.local` -> "Temporary failure in name resolution"; failed
avahi-daemon.service and .socket). On a booted testing-20261001-41873b5:

    avc: denied { nnp_transition } scontext=init_t tcontext=avahi_t
    avc: denied { create } comm="avahi-daemon" ... tcontext=avahi_var_run_t
    avahi-daemon.service: Main process exited, status=255

Hummingbird's avahi 0.9~rc4 unit sets NoNewPrivileges=yes, and the targeted
policy grants no init_t -> avahi_t nnp_transition, so the daemon stayed in
init_t and failed writing its pid file. (The earlier theory in the issue,
pid-directory ownership, was the symptom, not the cause.) Fedora's unit does
not set NNP. Drop it with a unit drop-in; avahi_t stays SELinux-confined.

Verified on the VM: with the drop-in, avahi-daemon is active as avahi_t,
no AVC denials, and `getent hosts utah-pub.local` resolves. Enabling the
units by default is projectbluefin#387 / projectbluefin#411.

Assisted-by: Claude Opus 5.5 via Claude Code
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security (info, in-scope)
system_files/shared/usr/lib/systemd/system/avahi-daemon.service.d/10-utah-selinux.conf:16 — NoNewPrivileges=no is a deliberate posture trade: upstream's unit (avahi-daemon.service.in) pairs NNP with SystemCallFilter=/RestrictSUIDSGID=/LockPersonality=, which stay in force because PID 1 holds CAP_SYS_ADMIN (systemd only re-implies NNP for unprivileged managers), and the process gains avahi_t confinement it lacked in init_t. Net gain, but the proper long-term fix is the policy grant (init_nnp_daemon_domain(avahi_t)) the drop-in comment already names (lines 13-14); consider tracking that removal as an issue so the drop-in doesn't outlive the policy fix.

No findings from: correctness, intent-alignment, style, docs-currency.

Confidence: 5/5 (safe)

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hanthor
hanthor merged commit d291c7a into projectbluefin:main Oct 3, 2026
14 checks passed
hanthor pushed a commit to arteeh/utah that referenced this pull request Oct 3, 2026
Utah shipped Avahi and switcheroo-control but left them disabled. Enable
avahi-daemon.service/.socket and switcheroo-control.service in
configure-services.sh and the desktop preset, install the avahi daemon
package, and require the units in the desktop contract (projectbluefin#387, projectbluefin#104).

Rebased onto main after projectbluefin#547 (package counts) and projectbluefin#549 (avahi SELinux
drop-in, which this needs for the daemon to start).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
hanthor pushed a commit that referenced this pull request Oct 3, 2026
Utah shipped Avahi and switcheroo-control but left them disabled. Enable
avahi-daemon.service/.socket and switcheroo-control.service in
configure-services.sh and the desktop preset, install the avahi daemon
package, and require the units in the desktop contract (#387, #104).

Rebased onto main after #547 (package counts) and #549 (avahi SELinux
drop-in, which this needs for the daemon to start).

Co-authored-by: castrojo <castrojo@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant