helios64: fix fancontrol service on trixie#8540
helios64: fix fancontrol service on trixie#8540Fil0sOFF wants to merge 1 commit intoarmbian:mainfrom
Conversation
fancontrol.service was "hardened" in Debian trixie. See Debian bug #944808. fancontrol can't access fans in /dev after this. This change returns full access to /dev for fancontrol.service
WalkthroughAdds a new systemd drop-in override for fancontrol on Helios64 to disable PrivateDevices. Introduces packages/bsp/helios64/fancontrol.service.noprivdev-override with [Service] PrivateDevices=no. Updates config/boards/helios64.conf to install this override to /etc/systemd/system/fancontrol.service.d/noprivdev.conf (mode 0644) during post_family_tweaks_bsp__helios64, positioned after the existing fancontrol.service.pid-override installation. No other changes. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
packages/bsp/helios64/fancontrol.service.noprivdev-override (2)
1-2: Retain hardening where possible: consider binding only the needed /dev nodes instead of full de-sandboxingPrivateDevices=no removes the /dev sandbox entirely. If the board only needs specific device nodes (e.g., /dev/i2c-0,/dev/i2c-1), a tighter alternative is to keep PrivateDevices=yes and bind just those nodes. That preserves most of the defense-in-depth.
Example alternative drop-in (adjust devices to what Helios64 actually uses):
[Service] PrivateDevices=yes BindPaths=/dev/i2c-0:/dev/i2c-0 BindPaths=/dev/i2c-1:/dev/i2c-1If PWM is only via sysfs (/sys/class/hwmon or /sys/class/pwm), PrivateDevices should not matter; in that case, re-check what exactly requires /dev on Helios64 (e.g., an I²C fan controller).
Would you like me to open a follow-up to prototype a minimal-bind setup once we confirm the exact device nodes needed?
1-2: Add a short rationale comment for future maintainersAdd context so this override isn’t “mysterious” a year from now. Suggestion:
-[Service] -PrivateDevices=no +# Helios64: Debian trixie fancontrol hardening (see Debian#944808) isolates /dev and breaks access +# to required device nodes on this board. Restore access here; consider minimal BindPaths in future. +[Service] +PrivateDevices=noI can amend the PR with this comment if you agree.
config/boards/helios64.conf (2)
43-43: Install path is fine; consider quoting vars and deterministic drop-in ordering
- Quoting $SRC and $destination is a minor hardening against whitespace/expansion issues.
- Using a numeric prefix like 10-noprivdev.conf creates deterministic ordering if more drop-ins are added later (even though there’s no conflict today).
Proposed tweak:
-install -m 644 $SRC/packages/bsp/helios64/fancontrol.service.noprivdev-override $destination/etc/systemd/system/fancontrol.service.d/noprivdev.conf +install -m 0644 "$SRC/packages/bsp/helios64/fancontrol.service.noprivdev-override" "$destination/etc/systemd/system/fancontrol.service.d/10-noprivdev.conf"
43-43: Ensure the drop-in is picked up on upgrades without requiring a rebootIf this file lands via a BSP package update on an already running system, systemd won’t notice new drop-ins until a daemon-reload (and fancontrol won’t pick it up until restart). Consider adding a daemon-reload + try-restart in the BSP postinst path.
Reference (from lib/functions/bsp/armbian-bsp-cli-deb.sh, board_side_bsp_cli_postinst_finish): it currently enables several services with --no-reload. You could append:
systemctl daemon-reload || true systemctl try-restart fancontrol.service || trueThis can be a separate, tiny follow-up PR if you prefer to keep this one scoped.
I can draft that follow-up change against armbian-bsp-cli postinst if you want.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
config/boards/helios64.conf(1 hunks)packages/bsp/helios64/fancontrol.service.noprivdev-override(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
config/boards/helios64.conf (1)
lib/functions/bsp/armbian-bsp-cli-deb.sh (2)
board_side_bsp_cli_postinst_finish(448-471)board_side_bsp_cli_postrm(417-423)
🔇 Additional comments (1)
packages/bsp/helios64/fancontrol.service.noprivdev-override (1)
1-2: Functional fix: disabling PrivateDevices restores /dev access for fancontrol on trixieThis is a pragmatic drop-in that should immediately unblock Helios64 on Debian trixie where the hardened unit breaks access to device nodes. No syntax issues. Applies cleanly as a unit drop-in.
|
A more granular approach would be to allow access only to required devices. I.e. Does that look better? |
|
Certainly better, but I am not sure it addresses the issue properly. I haven't had the chance to look into it deeply. You are circumventing an explicitly set security-policy. Just doesn't sound right. |
|
As far as i understand, I guess those udev rules must be used to deal with devices inside /sys/devices changing paths sometimes. Also, helios4 bsp has similar udev rules, so it must be suffering from this issue as well. |
I see. I have a helios4 unit but won't have access to it for another 2 months. |
|
My reading of the PrivateDevices= section at https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html is that the correct thing to do is to set DeviceAllow= What we probably need is a /etc/systemd/system/fancontrol.service file |
|
That was my initial thought as well. But it doesn't work. I guess it works for only device files, not directories. |
|
Hi team, @Fil0sOFF , I see this PR is still open, is there any workaround for those of us who are affected by this issue? |
|
Hello, I recently upgraded to Trixie, and in doing so, I had the pleasure of exploring its sandbox functions. Enable fancontrol
Fan Controlsudo nano Edit
|
|
Closing in favor of #8928 |
|
Mind please open a request for using BindPaths and restoring PrivateDevices=yes, but as I told in the other PR the hardening features of systemd were all enabled at once, and I doubt the Debian maintainer ever considered a requirement for /dev access or even see the PrivateDevices=yes as a critical requirement to keep the distribution safe. He simply thought no fancontrol used /dev symlinks in my opinion, so it would do no harm to remove its access. If you don't know why he did this hardening, please don't declare that doing the opposite is a security issue out of having an argument that proves it. And as far as I saw, there is not a single clue in the Debian bug report to enforce these hardening about why PrivateDevices=yes would be a requirement. But indeed, once the board is back to a working state I see no harm in hardening the board further (as the Debian dev saw no harm either), by only BindPath the device symlinks we currently need. Please open another PR above the more generic current one. And no fancontrol is even more hardened than a systemd hardened fancontrol. |
Description
fancontrol.service was "hardened" in Debian trixie. See Debian bug #944808.
fancontrol can't access fans in /dev after that.
This change returns full access to /dev for fancontrol.service
Checklist: