From: Chris PeBenito <pebenito@ieee.org>
To: Russell Coker <russell@coker.com.au>
Cc: selinux-refpolicy@vger.kernel.org
Subject: Re: udevadm etc
Date: Thu, 10 Dec 2020 11:29:09 -0500 [thread overview]
Message-ID: <42da4ce0-e353-7378-bd20-d15ceff8ce28@ieee.org> (raw)
In-Reply-To: <5107170.hMIqiVgsFT@liv>
On 12/9/20 7:02 PM, Russell Coker wrote:
> On Thursday, 10 December 2020 9:00:38 AM AEDT Chris PeBenito wrote:
>> On 12/9/20 7:38 AM, Russell Coker wrote:
>>> In systemd verision 247.1 (which is in Debian/Unstable now) systemd-udevd
>>> is a symlink to udevadm. In systemd version 241 (in Debian/Buster) it's
>>> not a symlink. The systemd changelog doesn't mention this change so I
>>> don't know exactly when it happened.
>>>
>>> type_transition init_t udevadm_exec_t:process udevadm_t;
>>> type_transition initrc_t udevadm_exec_t:process udevadm_t;
>>> type_transition sysadm_t udevadm_exec_t:process udevadm_t;
>>> type_transition consolekit_t udev_exec_t:process udev_t;
>>> type_transition devicekit_disk_t udev_exec_t:process udev_t;
>>> type_transition hald_t udev_exec_t:process udev_t;
>>> type_transition hotplug_t udev_exec_t:process udev_t;
>>> type_transition init_t udev_exec_t:process udev_t;
>>> type_transition initrc_t udev_exec_t:process udev_t;
>>> type_transition kernel_t udev_exec_t:process udev_t;
>>> type_transition virtd_t udev_exec_t:process udev_t;
>>>
>>> Above is a list of the relevant type_transition rules from refpolicy taken
>>> from git 3 days ago (there don't appear to be any udev changes since
>>> then).
>>>
>>> I think that the only thing to do is to have init_t and initrc_t run
>>> udevadm in the udev_t domain.
>>>
>>> Is it worth having a udevadm_t domain just for running it from sysadm_t or
>>> should we have that run as udev_t too?
>>
>> The udevadm_t domain is much smaller than udev_t, and critically doesn't
>> have all the device access udev_t has. Systemd merging the binaries into
>> one doesn't necessarily mean the policy has to merge too.
>
> Currently only 3 domains can transition to udevadm_t. 2 of those 3 also
> transition to udev_t so they can't use udevadm_t without code changes. The
> only remaining domain is sysadm_t.
>
> The question is not "do we have to merge the policy because systemd merges
> binaries" but "should we have a separate domain only used for sysadm_t"?
Ah, I misunderstood. The alternate question is, should any of these domains
that transition to udev_t actually transition to udevadm_t instead? For a long
time udevadm was labeled udev_exec_t.
I did some cursory searching in devicekit and I see udisks execs udevadm. I
couldn't find any instance of it executing udev, so there is a possibility of
udevadm_t being more useful.
If it ends up with sysadm_t being the only one that only execs udevadm, then I
agree that udevadm_t doesn't provide the hoped benefits.
--
Chris PeBenito
prev parent reply other threads:[~2020-12-10 16:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-09 12:38 udevadm etc Russell Coker
2020-12-09 22:00 ` Chris PeBenito
2020-12-10 0:02 ` Russell Coker
2020-12-10 16:29 ` Chris PeBenito [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42da4ce0-e353-7378-bd20-d15ceff8ce28@ieee.org \
--to=pebenito@ieee.org \
--cc=russell@coker.com.au \
--cc=selinux-refpolicy@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).