mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bradley Morgan <bradley.morgan@linux.dev>
To: Christian Brauner <brauner@kernel.org>, Serge Hallyn <serge@hallyn.com>
Cc: "Mickaël Salaün" <mic@digikod.net>,
	"Paul Moore" <paul@paul-moore.com>,
	"James Morris" <jmorris@namei.org>,
	"Josef Bacik" <josef@toxicpanda.com>,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] userns: security: Inform LSMs of capability check during userns creation
Date: Tue, 17 Nov 2026 16:36:54 +0000	[thread overview]
Message-ID: <69BA4071-048F-4D90-9936-4B4856AABDF7@linux.dev> (raw)
In-Reply-To: <20261117-brennen-tastatur-ekelhaft-22ee93d5200a@brauner>

On 17 November 2026 16:31:16 GMT, Christian Brauner <brauner@kernel.org>
wrote:
>On Sat, Nov 14, 2026 at 08:34:07AM -0600, Serge Hallyn wrote:
>> Nov 13, 2026 15:54:37 Bradley Morgan <bradley.morgan@linux.dev>:
>> 
>> > On 13 November 2026 21:39:33 GMT, "Serge E. Hallyn" <serge@hallyn.com>
>> > wrote:
>> >> On Wed, Nov 11, 2026 at 08:58:14PM +0000, Bradley Morgan wrote:
>> >>> Right now security_capable() gets called in create_user_ns() to
>snapshot
>> >>> whether the parent could setfcap, but the LSM gets zero context on
>where
>> >>> the check actually came from. It is the same story as setid: without
>a
>> >>> dedicated flag, security modules cannot tell this apart from regular
>> >>> capability checks.
>> >>>
>> >>> Add CAP_OPT_USERNS_CREATE and pass it along from create_user_ns().
>> >>
>> >> This should be patch 1/N in a set that introduces a user of it
>> >> in some lsm.
>> >
>> > hmm. Did you read Christians suggestion?
>> 
>> I did, when he first sent it. Actually it seems to me that what the
>> lsm would really like to know is that this is not for an immediate use
>> of setfcap, but possible future use. But that doesn't really matter. I
>> wasn't judging the patch. I was just going by what i believe is
>> general lsm subsystem policy.
>
>My main point is this: right now security_capable() doesn't actually
>specify what specific action it denies. I think we would be much better
>served if we had an enum that would allow us to annotate places where it
>matters what specific action is checked. I would make use of this in bpf
>lsms.

Does this patch look okay to you? Would you like any improvements? (Except
from adding a user) :)

>

--- Thanks!

      reply	other threads:[~2026-11-17 16:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 20:58 Bradley Morgan
2026-11-13 21:39 ` Serge E. Hallyn
2026-11-13 21:54   ` Bradley Morgan
2026-11-14 14:34     ` Serge Hallyn
2026-11-14 14:44       ` Bradley Morgan
2026-11-17 15:15         ` Serge E. Hallyn
2026-11-17 16:31           ` Bradley Morgan
2026-11-17 16:31       ` Christian Brauner
2026-11-17 16:36         ` Bradley Morgan [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=69BA4071-048F-4D90-9936-4B4856AABDF7@linux.dev \
    --to=bradley.morgan@linux.dev \
    --cc=brauner@kernel.org \
    --cc=jmorris@namei.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mic@digikod.net \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®