From: Casey Schaufler <casey@schaufler-ca.com>
To: Tomasz Unger <tomasz.unger@yahoo.pl>,
Sebastian Bockholt <sebastian.bockholt@bevuta.com>
Cc: linux-security-module@vger.kernel.org, paul@paul-moore.com,
serge@hallyn.com, jmorris@namei.org, audit@vger.kernel.org,
John Johansen <john.johansen@canonical.com>,
Casey Schaufler <casey@schaufler-ca.com>
Subject: Re: [PATCH] LSM: check if lsmprop_to_secctx call is supported by LSM
Date: Sat, 14 Nov 2026 10:14:46 -0800 [thread overview]
Message-ID: <58bb5c0e-6627-488f-a400-bf9cd5b60b22@schaufler-ca.com> (raw)
In-Reply-To: <20261111211722.69639-1-tomasz.unger@yahoo.pl>
On 11/11/2026 1:17 PM, Tomasz Unger wrote:
> On Fri, 19 Jun 2026 19:19:45 +0200, Sebastian Bockholt wrote:
>> In include/linux/lsm_hook_defs.h, lsmprop_to_secctx is defined with
>> a default return value of -EOPNOTSUPP.
>> The function bpf_lsm_lsmprop_to_secctx, defined in
>> security/bpf/hooks.c, returns the hook's default value. Therefore,
>> directly returning the result of the bpf_lsm_lsmprop_to_secctx call
>> propagates an unchecked EOPNOTSUPP error.
> [...]
>
>> - return scall->hl->hook.lsmprop_to_secctx(prop, cp);
>> + error = scall->hl->hook.lsmprop_to_secctx(prop, cp);
>> + if (error == -EOPNOTSUPP)
>> + continue;
>> + return error;
> Hi,
>
> I ran into the same problem independently and would like to revive this
> patch. It fixes a regression that is still present in v7.4-rc2, in
> next-20261111 and in the current audit and lsm dev branches.
As currently implemented the LSM infrastructure supports only one
LSM providing conversions between the LSM security state (lsmprop or secid)
and the security context (secctx). I have been working on removing
this restriction for the past 16 years. It isn't done, and every time
someone tries to do something that expects otherwise it breaks. The
BPF LSM registers hooks that do nothing for (most) every case. That
only works if the BPF LSM is registered after any LSM that provides
real hooks. We've told y'all that many times.
If you really want the BPF LSM to stack properly you have options.
You can stop registering hooks that can't function properly in the
stack you want to use. You can help with getting the stacking complete.
You can continue to ask for individual tweeks each time they come up.
Maybe taking this change is the best we can hope for. My frustration
level is getting pretty high with the whole situation.
prev parent reply other threads:[~2026-11-14 18:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-19 17:19 [PATCH] LSM: check if lsmprop_to_secctx call is supported by LSM Sebastian Bockholt
2026-06-19 17:44 ` Casey Schaufler
2026-06-24 17:44 ` Sebastian Bockholt
2026-06-24 19:36 ` Casey Schaufler
2026-06-25 15:24 ` Sebastian Bockholt
2026-11-11 21:17 ` Tomasz Unger
2026-11-14 18:14 ` Casey Schaufler [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=58bb5c0e-6627-488f-a400-bf9cd5b60b22@schaufler-ca.com \
--to=casey@schaufler-ca.com \
--cc=audit@vger.kernel.org \
--cc=jmorris@namei.org \
--cc=john.johansen@canonical.com \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=sebastian.bockholt@bevuta.com \
--cc=serge@hallyn.com \
--cc=tomasz.unger@yahoo.pl \
/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