From: Casey Schaufler <casey@schaufler-ca.com>
To: Stephen Smalley <stephen.smalley.work@gmail.com>
Cc: paul@paul-moore.com, linux-security-module@vger.kernel.org,
jmorris@namei.org, serge@hallyn.com, keescook@chromium.org,
john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp,
linux-kernel@vger.kernel.org, selinux@vger.kernel.org,
Casey Schaufler <casey@schaufler-ca.com>
Subject: Re: [PATCH 2/2] LSM: Allow reservation of netlabel
Date: Fri, 10 Oct 2025 14:10:57 -0700 [thread overview]
Message-ID: <01879779-d529-40f2-8693-257cc598dcd7@schaufler-ca.com> (raw)
In-Reply-To: <CAEjxPJ5N+vGS4rhBJmCfoW+rUnjPm7TVAC9reRmu6YCaJWTO+Q@mail.gmail.com>
On 10/10/2025 12:53 PM, Stephen Smalley wrote:
> On Fri, Oct 10, 2025 at 11:09 AM Casey Schaufler <casey@schaufler-ca.com> wrote:
>> On 10/9/2025 11:53 AM, Stephen Smalley wrote:
>>> On Wed, Oct 1, 2025 at 5:56 PM Casey Schaufler <casey@schaufler-ca.com> wrote:
>>>> Allow LSMs to request exclusive access to the netlabel facility.
>>>> Provide mechanism for LSMs to determine if they have access to
>>>> netlabel. Update the current users of netlabel, SELinux and Smack,
>>>> to use and respect the exclusive use of netlabel.
>>>>
>>>> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
>>>> ---
>>>> diff --git a/security/security.c b/security/security.c
>>>> index e59e3d403de6..9eca10844b56 100644
>>>> --- a/security/security.c
>>>> +++ b/security/security.c
>>>> @@ -289,6 +289,12 @@ static void __init lsm_set_blob_sizes(struct lsm_blob_sizes *needed)
>>>> else
>>>> blob_sizes.lbs_secmark = true;
>>>> }
>>>> + if (needed->lbs_netlabel) {
>>>> + if (blob_sizes.lbs_netlabel)
>>>> + needed->lbs_netlabel = false;
>>>> + else
>>>> + blob_sizes.lbs_netlabel = true;
>>>> +
>>> Same principle here - if a LSM wants to use netlabel, it may want to
>>> guarantee that it truly has exclusive access to it no matter what the
>>> LSM order is.
>> And if SELinux and Smack both shout "I gotta have it!" who wins?
>> Does the system fail to boot? Do you assign it to the first requestor,
>> as this patch does explicitly?
>>
>> If LSMs can't be equal in the eyes of the infrastructure, If one (e.g. SELinux)
>> always gets its way regardless of the end user intent, I have a problem with
>> the whole thing.
> End user intent is unlikely to be expressed as a silent side effect of
> LSM order.
But that's what we have now with the "first exclusive LSM" rule.
And the patch doesn't have a "silent" side effect. An LSM is informed
at initialization whether it can use secmarks. An LSM could even
decide to use secmarks if it has been told not to. That would be wrong,
and probably not upstream acceptable, but in security the wild and wacky
happens all too often.
> If a security module supports its use without the use of secmark
> and/or netlabel and the end user wants to assign one or both to
> another security module, that's fine.
That is what this patch implements.
> But some security modules may not function correctly (or at all) if
> secmark and/or netlabel are silently disabled on them, and the end
> user needs a better way to express intent.
I'm open to suggestions. Would boot options lsm.secmark and lsm.netlabel
be sufficient to address your concern?
next prev parent reply other threads:[~2025-10-10 21:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20251001215643.31465-1-casey.ref@schaufler-ca.com>
2025-10-01 21:56 ` [PATCH 0/2] LSM: Identify module using network facilities Casey Schaufler
2025-10-01 21:56 ` [PATCH 1/2] LSM: Exclusive secmark usage Casey Schaufler
2025-10-09 18:49 ` Stephen Smalley
2025-10-10 15:02 ` Casey Schaufler
2025-10-13 22:11 ` Paul Moore
2025-11-04 16:58 ` Casey Schaufler
2025-10-13 21:57 ` Paul Moore
2025-11-04 16:41 ` Casey Schaufler
2025-10-01 21:56 ` [PATCH 2/2] LSM: Allow reservation of netlabel Casey Schaufler
2025-10-09 18:53 ` Stephen Smalley
2025-10-10 15:08 ` Casey Schaufler
2025-10-10 19:53 ` Stephen Smalley
2025-10-10 21:10 ` Casey Schaufler [this message]
2025-10-13 22:21 ` Paul Moore
2025-11-04 17:07 ` Casey Schaufler
2025-11-04 17:01 ` Casey Schaufler
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=01879779-d529-40f2-8693-257cc598dcd7@schaufler-ca.com \
--to=casey@schaufler-ca.com \
--cc=jmorris@namei.org \
--cc=john.johansen@canonical.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=selinux@vger.kernel.org \
--cc=serge@hallyn.com \
--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 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®