Thanks for you effort to make the snap working under confinement.
Reading total system memory needs to scan /sys/firmware/dmi/entries/ to find the DMI Type 17 entry – that directory listing itself gets denied under strict, and we haven’t found an interface that grants it.
I think this should be already covered by hardware-observe interface.
Our battery/perf code writes shared kernel sysfs paths (power_supply, platform_profile) that system-files’ own policy says we shouldn’t use it for, since we’re not the “clear owner.”
Could you please clarify what are the concrete requirements (paths / operations)?
power-control interface may already cover the power_supply requirement.
I think we could possibly add platform_profile to power-control as well (either via sysfs direct access or via power-profiles-daemon dbus interface).
If this is decided, it may be possibly to grant access via system-files as a temporal solution until the interface is updated.
The battery sysfs path is a symlink that resolves to a machine-specific string, so the working declaration isn’t portable across models.
This is possibly covered by power-control already as well. Otherwise, we will need to update the interface.
Could you please check it hardware-observe and power-control already cover these requirements?
So anyone on stable today still hits this. We’ll be fine once 2.78 reaches stable.
Let me double check when is 2.78 expected to reach stable. I think it should be at some point this week.
Yes, we need to add the platform_profile permission as discussed.
@shishirsub10 will kindly open a PR in snapd. In the meantime it might be ok to grant access via system-files
/sys/firmware/acpi/platform_profile
/sys/firmware/acpi/platform_profile_choices
@pedronis do you see any potential issue with this temporal workaround? I believe it would need an override as the current policy clearly states
acceptance in the store requires that the interface is not be used to access system files where the snap is not the clear owner (eg, /dev, /proc, /sys, /usr, etc)."
@asusapp would this cover all the requirements or is there anything still missing?
I’ve been told that we have already started with the progressive rollout of 2.78, so I believe it should be available to all users during the following days
@asusapp To wrap up and proceed to the reviewers’ vote, could you please share which specific interfaces ended up in the working snapcraft.yaml and, therefore, which auto-connections are required?
Here’s the full interface list from our working strict-confinement yaml (snap name: myasus-for-linux, apps: myasus-for-linux / batteryperf-daemon / batteryperf-reapply):
hardware-observe – board identification + DMI memory info (read-only)
system-files – platform_profile (fan mode, pending PR #17895) and a few EFI variables (dedicated memory, NVIDIA ARM64 only); platform_profile pending PR #17895
custom-device (self-declared plug+slot, asus-ec-hid) – /dev/hidraw* access for the ARM64 EC fallback path
Standard auto-connect, no review needed:
network / network-bind – our own daemon socket
desktop / wayland / x11 – GUI rendering
All of the above now verified working on real hardware, both x86 and ARM64 (custom-device included).
Four separate blockers found so far, in addition to the interface list above:
Fan mode on x86 (platform_profile) – already covered by your PR #17895, no action needed from us.
Dedicated memory EFI variable, second write fails. Writing the variable a second time (change the value, or clear it back to Auto) needs CAP_LINUX_IMMUTABLE to clear the immutable flag first (ioctl(FS_IOC_SETFLAGS)). The first write to a not-yet-existing variable works fine; any write after that is denied. Checked the live AppArmor profile – none of our connected interfaces grant this capability. Does one exist, or would it need adding?
D-Bus sync to net.hadess.PowerProfiles (ARM64 fan mode display) fails. On ARM64 we write the EC directly over custom-device (works fine), then try to push the result to PowerProfiles so GNOME’s display matches – that D-Bus call fails. We checked snapd’s built-in interfaces and found none covering net.hadess.PowerProfiles.
No way to show the system’s reboot confirmation prompt.org.gnome.SessionManager.Reboot() (the call that makes GNOME show its “restart now?” dialog) also fails under strict, same cause as #3 – no built-in interface grants it. We found shutdown (org.freedesktop.login1.Manager.Reboot), but that does an immediate reboot with no user prompt, so it doesn’t give us the same behavior.
For #3 and #4: same root cause – the D-Bus connection itself is being denied (confirmed with busctl, fails before any specific method gets checked), not a missing method-level permission. Fixing that connection issue might resolve both, though method-level permissions for each service may still be needed on top.
If #2/#3/#4 can’t be covered, our fallback is to skip the parts that need them (dedicated memory stays write-once until reboot, ARM64 fan mode just won’t sync the GNOME display, and reboot becomes a manual “please restart” message in our own UI) – functionally degraded but not blocked. Let us know if any of these have an existing answer we missed.
#2 This may be the most problematic one I think. For my understanding, could you please provide more details about what this functionality is used for?
#3 This possibly could be added to power-control interface in the same PR. The downside is that there is no temporal workaround as with system-files, this will need to wait until the PR is merged and shipped in the next snapd release
#4 I think the shutdown interface should cover this one.
#2 – more detail: this is for “dedicated memory” on our NVIDIA ARM64 boards, a BIOS/firmware setting that reserves part of system RAM for the GPU. There’s no runtime API for this – the only way to change it is by writing a fixed-path EFI variable that the BIOS reads and applies on the next boot (that’s also why a reboot is required to take effect). Our app lets the user change the reserved amount, or clear it back to “Auto” – both are writes to that one specific EFI variable (not an arbitrary path). The first write to it works fine (variable doesn’t exist yet, nothing to clear). Any write after that fails, because the variable file is marked immutable by efivarfs once it exists, and clearing that needs CAP_LINUX_IMMUTABLE (ioctl(FS_IOC_SETFLAGS)), which none of our connected interfaces grant.
#3 – understood, we’ll just wait for that PR + the snapd release, same as #1. No urgency on our side.
#4 – to be clear on what we actually need: any of these would work for us –
our own app shows a confirm dialog, then triggers the reboot
the desktop session (GNOME) shows its own confirm dialog, then reboots
reboot triggers immediately with no confirmation at all
We tested shutdown on real hardware: it installs under strict, we could manually snap connect it, and calling org.freedesktop.login1.Manager.Reboot() through it actually rebooted the machine – immediately, no confirmation prompt (that’s #3 above). So the mechanism works; we just want to confirm manual-connecting a review-gated interface like this is reasonable, or if there’s a better path for #1/#2. Fallback either way: an in-app “please restart manually” message.
One more general question while we’re at it: when a declared interface goes through manual review, is approval all-or-nothing for the snap, or can some of our declared interfaces get approved for auto-connect while others stay pending/manual? Trying to understand whether declaring a higher-risk interface like shutdown could hold up review for the rest of the list.
#2 Thanks a lot for the explanation. Let me think a bit more about this one, but we may need to fall back to the “dedicated memory stays write-once until reboot” approach.
#4 Sorry, I misread it. I think that “our own app shows a confirmation dialog, then triggers the reboot” is possibly the best path forward here. I believe that granting auto-connection to the shutdown interface is appropriate in this case, but there’s also no issue if you prefer to stick with manual connection. Just let us know.
Thanks
One more general question while we’re at it: when a declared interface goes through manual review, is approval all-or-nothing for the snap, or can some of our declared interfaces get approved for auto-connect while others stay pending/manual? Trying to understand whether declaring a higher-risk interface like shutdown could hold up review for the rest of the list.
Each interface is reviewed and granted individually, so this should not be a problem at all.
#4 – sounds good, we’ll go with our own app showing the confirm dialog and then calling Reboot(). Auto-connect on shutdown works for us, no need to keep it manual.
#2 – no rush, take your time. One correction on our side though: the “write-once until reboot” phrasing we used earlier was wrong. The variable isn’t consumed/cleared by the BIOS on reboot – its existence is the setting (absent = Auto, present with a value = that value), permanently. So the real fallback is “write-once, period”: once a user picks a non-Auto value, they can’t change it again or go back to Auto from our app at all, not just until the next reboot. Wanted to flag that since it changes how bad the fallback actually is.