minkipc: Add distro-specific user/group overrides for systemd services#73
Open
arakshit011 wants to merge 1 commit into
Open
minkipc: Add distro-specific user/group overrides for systemd services#73arakshit011 wants to merge 1 commit into
arakshit011 wants to merge 1 commit into
Conversation
13fba3a to
b907a50
Compare
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>
b907a50 to
7cc5ca2
Compare
|
|
||
| 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" |
Contributor
There was a problem hiding this comment.
Have we validated this doesn't cause any regression with meta-qcom? I know you need these node group assignments for Debian/Ubuntu first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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