Skip to content

Is unconfined_mount_t allowed to run with system role ? #1100

Description

@GargiQcom

Hi,

In our setup, we use adb shell to perform certain operations, where the shell runs with developer (root) privileges.

Since meta-selinux does not provide an adb domain, the SELinux policy for adb shell has been added via meta-openembedded. The relevant patch is available here:
https://github.com/openembedded/meta-openembedded/blob/master/meta-oe/dynamic-layers/selinux/recipes-security/refpolicy/refpolicy-targeted/0001-Added-sepolicy-for-adb-service.patch

On the target, the adb shell context is as follows:

adb shell id
uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:unconfined_t:s0

When running the mount command from this shell, we encounter the following SELinux error:

type=SELINUX_ERR msg=audit(44.591:158): op=security_compute_sid
invalid_context="system_u:system_r:unconfined_mount_t:s0"
scontext=system_u:system_r:unconfined_t:s0
tcontext=system_u:object_r:mount_exec_t:s0
tclass=process

This suggests that unconfined_mount_t is not permitted to run with the system role.

Could you please advise whether it is acceptable to allow unconfined_mount_t to run with the system role as well?
Specifically, is the following change to refpolicy considered acceptable?
https://github.com/openembedded/meta-openembedded/pull/1035/changes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions