SELinux Archive mirror
 help / color / mirror / Atom feed
From: Chris PeBenito <chpebeni@linux.microsoft.com>
To: SElinux mailing list <selinux@vger.kernel.org>,
	brauner@kernel.org, bluca@debian.org
Subject: Proposed feature: fine-grained file descriptors in SELinux
Date: Thu, 9 Nov 2023 13:26:24 -0500	[thread overview]
Message-ID: <da1d9efd-fdc1-4651-8a7a-30ae4a399926@linux.microsoft.com> (raw)

systemd is increasing usage of memfds, pidfds, etc.  This is resulting 
in a need for wide inheritance of fds across the system.  For example in 
a lot of systemd interfaces that have a pid field now have a comparable 
pidfd interface.  dbus-broker and polkit are similarly updated.

Some references from an All Systems Go! talk: 
https://cfp.all-systems-go.io/media/all-systems-go-2023/submissions/T3LJAM/resources/ASG_2023_PID_FD-ize_all_the_things_E98Zw9Q.pdf 
  This is from a few months ago; the switch to PIDFDs is nearly 
complete, and we're already seeing denials for this usage.


Since file descriptors are increasing use as references for various 
operations, I think it would be useful to have a finer-grained fd class, 
so we can limit file descriptor inheritance, particularly as it looks 
like systemd/pid1 will need to inherit pidfd file descriptors from 
possibly all domains.  Specifically, I propose adding new permissions to 
the fd class, such as use_pidfd and use_memfd.  Then systemd can use 
pidfds from any domain, but only use regular fds from trusted domains.

Thoughts?

-- 
Chris PeBenito

             reply	other threads:[~2023-11-09 18:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 18:26 Chris PeBenito [this message]
2023-11-13  4:52 ` Proposed feature: fine-grained file descriptors in SELinux Paul Moore
2023-11-13 15:35   ` Stephen Smalley
2023-11-14  6:22     ` Paul Moore
2023-11-14 14:14     ` Chris PeBenito
2023-11-14 14:31       ` Stephen Smalley

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=da1d9efd-fdc1-4651-8a7a-30ae4a399926@linux.microsoft.com \
    --to=chpebeni@linux.microsoft.com \
    --cc=bluca@debian.org \
    --cc=brauner@kernel.org \
    --cc=selinux@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 read-only IMAP folder(s) and NNTP newsgroup(s).