Skip to content

Draft: LACT profile - #1088

Draft
JND94 wants to merge 5 commits into
roddhjav:mainfrom
JND94:LACT
Draft

Draft: LACT profile#1088
JND94 wants to merge 5 commits into
roddhjav:mainfrom
JND94:LACT

Conversation

@JND94

@JND94 JND94 commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

LACT is a popular GUI for configuring and monitoring GPUs
Since it combines root access with a GUI, it could introduce some risks

Missing a lot of rules, especially with Nvidia/Intel and there's probably some duplicates for /sys rules
I'm sorry this is probably not well ordered

@roddhjav

roddhjav commented Apr 1, 2026

Copy link
Copy Markdown
Owner

Do you mean https://github.com/ilya-zlobintsev/LACT ?

If so, it does not run as root, it uses a lactd daemon to collect data. Therefore, a profile for lactd would be nice to have too.

Edit: it is not lactd but lact daemon. It explain a few things. But it is a really bad way to (not) separate privileged daemon and user land GUI. They should really have a different binary for the privilliged part.

Comment thread apparmor.d/groups/utils/lact Outdated
profile lact @{exec_path} {
include <abstractions/base>
include <abstractions/graphics>
include <abstractions/gtk-strict>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

include <abstractions/gtk-strict>

Use include <abstractions/desktop> instead, it includes a lot of rules you added in this profiles.

Comment thread apparmor.d/groups/utils/lact Outdated
Comment on lines +16 to +18
include <abstractions/icons>
include <abstractions/fontconfig-cache>
include <abstractions/fonts-strict>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Part of abstractions/desktop

Comment thread apparmor.d/groups/utils/lact Outdated

/etc/lact/ r,
/etc/lact/config.yaml rw,
/etc/group r,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

In nameservice-strict

Comment thread apparmor.d/groups/utils/lact Outdated
Comment on lines +35 to +38
/usr/share/libdrm/* r,
/usr/share/hwdata/pci.ids r,
/usr/share/xkeyboard-config-2/{,**} r,
/usr/share/glib-2.0/schemas/gschemas.compiled r,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Part of abstractions/desktop

Comment thread apparmor.d/groups/utils/lact Outdated
Comment on lines +42 to +44
owner @{user_config_dirs}/dconf/user r,

owner @{run}/user/@{uid}/dconf/user rw,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Use abstractions/dconf-write instead

Comment thread apparmor.d/groups/utils/lact Outdated
/usr/share/xkeyboard-config-2/{,**} r,
/usr/share/glib-2.0/schemas/gschemas.compiled r,

owner @{user_cache_dirs}/gtk-4.0/** rwk,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Part of abstractions/desktop

Comment thread apparmor.d/groups/utils/lact Outdated
#@{bin}/vulkaninfo rPx -> vulkaninfo,
@{bin}/vulkaninfo rPux,
@{bin}/uname rPx,
@{bin}/clinfo cx -> clinfo,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What is this thing? it is not part of the lact

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's part of lact gui , package also depends on these
It should be for retrieving graphics api data

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I meant @{bin}/clinfo only ?

Comment thread apparmor.d/groups/utils/lact Outdated
Comment on lines +78 to +80
@{sys}/devices/virtual/kfd/kfd/topology/nodes/@{int}/properties r,
@{sys}/devices/virtual/kfd/kfd/topology/nodes/@{int}/caches/ r,
@{sys}/devices/virtual/kfd/kfd/topology/nodes/@{int}/caches/@{int}/properties r,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Already included in abstraction/graphics-full

Comment thread apparmor.d/groups/utils/lact Outdated
Comment on lines +74 to +76
@{sys}/devices/@{pci}/hwmon/hwmon@{int}/pwm@{int}_enable rw,
@{sys}/devices/@{pci}/hwmon/hwmon@{int}/power@{int}_cap rw,
@{sys}/devices/@{pci}/hwmon/hwmon@{int}/pwm@{int} rw,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Use one the the specialized abstraction instead: https://apparmor.pujol.io/abstractions/sys/

Comment thread apparmor.d/groups/utils/lact Outdated
@{sys}/class/drm/ r,
@{sys}/devices/@{pci}/drm/ r,
@{sys}/devices/@{pci}/uevent r,
@{sys}/devices/@{pci}/hwmon/{,**} r,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

For all hwmon use one of the hwmon abs: https://apparmor.pujol.io/abstractions/generic/#hwmon

Comment thread apparmor.d/groups/utils/lact Outdated
Comment on lines +47 to +48

@{sys}/bus/pci/devices/ r,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Most of the rules in @{sys}, should be covered by the abstraction/graphics-full abstraction. Please only keep the ones not in the abs.

Comment thread apparmor.d/groups/utils/lact Outdated
@{PROC}/uptime r,
@{PROC}/cmdline r,
@{PROC}/sys/kernel/random/boot_id r,
@{tmp}/VP_VULKANINFO*.json rw,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

It should be:

/tmp/VP_VULKANINFO*.json rw,

or:

owner @{tmp}/VP_VULKANINFO*.json rw,

Can the * be precised (int, rand6...)

Also move the line before owner @{run}/user...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it can't be precised as the filename follows with the GPU name before the extension

Comment thread apparmor.d/groups/utils/lact Outdated
capability chown,

network netlink raw,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You need to add @{exec_path} mr, here too

Comment thread apparmor.d/profiles-g-l/lact Outdated
include <abstractions/graphics>
include <abstractions/nameservice-strict>

#silencer deny capability sys_admin

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure why does it need these caps, I don't think they're actually needed for this profile

@JND94

JND94 commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

mkinitcpio should probably transition to the actual profile as it probably adds the needed boot param for amdgpus to unlock overclocking, still investigating, in that case we should add support for the rest of distros

@JND94
JND94 marked this pull request as draft June 24, 2026 07:41
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.

2 participants