All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: John Johansen <john.johansen@canonical.com>
Cc: Stephen Smalley <stephen.smalley.work@gmail.com>,
	Paul Moore <paul@paul-moore.com>,
	linux-security-module@vger.kernel.org, selinux@vger.kernel.org
Subject: Re: LSM namespacing API
Date: Thu, 21 Aug 2025 09:26:25 -0500	[thread overview]
Message-ID: <aKcskclwVVe1X4kP@mail.hallyn.com> (raw)
In-Reply-To: <67e72960-c985-48e1-aaeb-a4286cc8508f@canonical.com>

On Thu, Aug 21, 2025 at 12:46:10AM -0700, John Johansen wrote:
> On 8/19/25 10:47, Stephen Smalley wrote:
> > On Tue, Aug 19, 2025 at 10:56 AM Paul Moore <paul@paul-moore.com> wrote:
> > > 
> > > Hello all,
> > > 
> > > As most of you are likely aware, Stephen Smalley has been working on
> > > adding namespace support to SELinux, and the work has now progressed
> > > to the point where a serious discussion on the API is warranted.  For
> > > those of you are unfamiliar with the details or Stephen's patchset, or
> > > simply need a refresher, he has some excellent documentation in his
> > > work-in-progress repo:
> > > 
> > > * https://github.com/stephensmalley/selinuxns
> > > 
> > > Stephen also gave a (pre-recorded) presentation at LSS-NA this year
> > > about SELinux namespacing, you can watch the presentation here:
> > > 
> > > * https://www.youtube.com/watch?v=AwzGCOwxLoM
> > > 
> > > In the past you've heard me state, rather firmly at times, that I
> > > believe namespacing at the LSM framework layer to be a mistake,
> > > although if there is something that can be done to help facilitate the
> > > namespacing of individual LSMs at the framework layer, I would be
> > > supportive of that.  I think that a single LSM namespace API, similar
> > > to our recently added LSM syscalls, may be such a thing, so I'd like
> > > us to have a discussion to see if we all agree on that, and if so,
> > > what such an API might look like.
> > > 
> > > At LSS-NA this year, John Johansen and I had a brief discussion where
> > > he suggested a single LSM wide clone*(2) flag that individual LSM's
> > > could opt into via callbacks.  John is directly CC'd on this mail, so
> > > I'll let him expand on this idea.
> > > 
> > > While I agree with John that a fs based API is problematic (see all of
> > > our discussions around the LSM syscalls), I'm concerned that a single
> > > clone*(2) flag will significantly limit our flexibility around how
> > > individual LSMs are namespaced, something I don't want to see happen.
> > > This makes me wonder about the potential for expanding
> > > lsm_set_self_attr(2) to support a new LSM attribute that would support
> > > a namespace "unshare" operation, e.g. LSM_ATTR_UNSHARE.  This would
> > > provide a single LSM framework API for an unshare operation while also
> > > providing a mechanism to pass LSM specific via the lsm_ctx struct if
> > > needed.  Just as we do with the other LSM_ATTR_* flags today,
> > > individual LSMs can opt-in to the API fairly easily by providing a
> > > setselfattr() LSM callback.
> > > 
> > > Thoughts?
> > 
> > I think we want to be able to unshare a specific security module
> > namespace without unsharing the others, i.e. just SELinux or just
> > AppArmor.
> 
> yes which is part of the problem with the single flag. That choice
> would be entirely at the policy level, without any input from userspace.

AIUI Paul's suggestion is the user can pre-set the details of which
lsms to unshare and how with the lsm_set_self_attr(), and then a
single CLONE_LSM effects that.

-serge

  reply	other threads:[~2025-08-21 14:26 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-19 14:56 LSM namespacing API Paul Moore
2025-08-19 17:11 ` Casey Schaufler
2025-08-19 18:40   ` Paul Moore
2025-08-19 18:58     ` Stephen Smalley
2025-08-21  7:26       ` John Johansen
2025-08-21  7:23     ` John Johansen
2025-08-22  1:57       ` Paul Moore
2025-08-22 14:30         ` John Johansen
2025-08-21 10:00     ` Mickaël Salaün
2025-08-22  2:14       ` Paul Moore
2025-08-22 14:47         ` Casey Schaufler
2025-08-22 19:59           ` John Johansen
2025-08-23 17:41             ` Dr. Greg
2025-08-23 23:00               ` John Johansen
2025-08-19 17:47 ` Stephen Smalley
2025-08-19 18:51   ` Paul Moore
2025-08-19 18:52     ` Paul Moore
2025-08-20 14:44     ` Mickaël Salaün
2025-08-20 15:37       ` Casey Schaufler
2025-08-20 20:47       ` Paul Moore
2025-08-21  9:56         ` Mickaël Salaün
2025-08-21 14:18           ` John Johansen
2025-08-22  2:09           ` Paul Moore
2025-08-21  2:05     ` Serge E. Hallyn
2025-08-21  2:35       ` Paul Moore
2025-08-21  3:02         ` Serge E. Hallyn
2025-08-22  1:50           ` Paul Moore
2025-08-21  8:12         ` John Johansen
2025-08-21  8:07       ` John Johansen
2025-08-21  7:46   ` John Johansen
2025-08-21 14:26     ` Serge E. Hallyn [this message]
2025-08-21 14:57       ` John Johansen
2025-09-01 16:01         ` Dr. Greg
2025-09-01 17:31           ` Casey Schaufler
2025-09-04  2:16             ` Dr. Greg
2025-09-04 17:40               ` Casey Schaufler
2025-09-02 10:55           ` John Johansen
2025-09-05 22:14             ` Dr. Greg
2025-09-06  2:01               ` John Johansen
2025-08-22  1:59     ` Paul Moore
2025-08-21  7:14 ` John Johansen
2025-08-21 11:20 ` Dr. Greg
2025-08-21 14:44   ` John Johansen
2026-02-26  0:05 ` Paul Moore
2026-03-03 13:30   ` Stephen Smalley
2026-03-03 16:46     ` Paul Moore
2026-03-06 17:48       ` Dr. Greg
2026-03-06 21:01         ` Casey Schaufler
2026-03-09 18:15           ` Stephen Smalley
2026-03-11 16:37             ` Casey Schaufler
2026-03-24 21:31       ` Paul Moore
2026-03-29 16:09         ` Dr. Greg
2026-03-30  0:56           ` Paul Moore
2026-04-02 10:59             ` Dr. Greg
2026-04-02 17:49               ` Casey Schaufler
2026-04-02 19:31                 ` Paul Moore
2026-04-02 21:04               ` Paul Moore

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=aKcskclwVVe1X4kP@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=john.johansen@canonical.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=selinux@vger.kernel.org \
    --cc=stephen.smalley.work@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.