Skip to content

minkipc: Add distro-specific user/group overrides for systemd services#73

Open
arakshit011 wants to merge 1 commit into
qualcomm:mainfrom
arakshit011:add-user-group
Open

minkipc: Add distro-specific user/group overrides for systemd services#73
arakshit011 wants to merge 1 commit into
qualcomm:mainfrom
arakshit011:add-user-group

Conversation

@arakshit011

@arakshit011 arakshit011 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Previously, qteesupplicant service and other resources configured from udev rules were defaulted to running as root. Running services as root is discouraged as it violates the principle of least privilege.

Additionally, running services and their resources under separate user/group provides better isolation among QTEE services and prevents tampering by other users.

This change introduces two CMake cache variables, DISTRO_USER and DISTRO_GROUP (both defaulting to "root"), allowing distros to configure the owning user and group independently. The values are substituted into the qteesupplicant unit files, as well as the qcomtee udev rules.

Also adds udev rules for UFS and eMMC RPMB devices to configure them with the same user and group.

The sfsconfig service is not provided with a separate user and group and remains as root, since it is a one-shot service responsible only for creating directories.

Signed-off-by: Abhinaba Rakshit abhinaba.rakshit@oss.qualcomm.com
CRs-Fixed: 4560808

@arakshit011 arakshit011 marked this pull request as draft June 4, 2026 23:03
@arakshit011 arakshit011 marked this pull request as ready for review June 5, 2026 07:37
Previously, qteesupplicant service and other resources configured from
udev rules were defaulted to running as root. Running services as root
is discouraged as it violates the principle of least privilege.

Additionally, running services and their resources under separate
user/group provides better isolation among QTEE services and prevents
tampering by other users.

This change introduces two CMake cache variables, DISTRO_USER and
DISTRO_GROUP (both defaulting to "root"), allowing distros to configure
the owning user and group independently. The values are substituted into
the qteesupplicant unit files, as well as the qcomtee udev rules.

Also adds udev rules for UFS and eMMC RPMB devices to configure
them with the same group. Ownership is still with root as the devices
are created by kernel.

The sfsconfig service is not provided with a separate user and group and
remains as root, since it is a one-shot service responsible only for
creating directories.

Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>

KERNEL=="tee[0-9]*", MODE="0660", OWNER="root", TAG+="systemd" ENV{SYSTEMD_WANTS}+="qteesupplicant.service"
KERNEL=="tee[0-9]*", MODE="0660", OWNER="root", GROUP="@DISTRO_GROUP@", TAG+="systemd" ENV{SYSTEMD_WANTS}+="qteesupplicant.service"
KERNEL=="0:0:0:49476", SUBSYSTEM=="bsg", MODE="0660", OWNER="root", GROUP="@DISTRO_GROUP@", TAG+="systemd" ENV{SYSTEMD_WANTS}+="qteesupplicant.service"

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.

Have we validated this doesn't cause any regression with meta-qcom? I know you need these node group assignments for Debian/Ubuntu first.

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