From: "Mickaël Salaün" <mic@digikod.net>
To: Paul Moore <paul@paul-moore.com>
Cc: Jann Horn <jannh@google.com>,
Christian Brauner <brauner@kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Casey Schaufler <casey@schaufler-ca.com>,
Tahera Fahimi <fahimitahera@gmail.com>,
gnoack@google.com, jmorris@namei.org, serge@hallyn.com,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: f_modown and LSM inconsistency (was [PATCH v2 1/4] Landlock: Add signal control)
Date: Mon, 12 Aug 2024 19:27:53 +0200 [thread overview]
Message-ID: <20240812.Fie3aCh2eiwi@digikod.net> (raw)
In-Reply-To: <CAHC9VhQY+H7n2zCn8ST0Vu672UA=_eiUikRDW2sUDSN3c=gVQw@mail.gmail.com>
On Mon, Aug 12, 2024 at 12:30:03PM -0400, Paul Moore wrote:
> On Mon, Aug 12, 2024 at 11:06 AM Jann Horn <jannh@google.com> wrote:
> > On Mon, Aug 12, 2024 at 4:57 PM Paul Moore <paul@paul-moore.com> wrote:
> > > On Mon, Aug 12, 2024 at 9:09 AM Jann Horn <jannh@google.com> wrote:
> > > > On Mon, Aug 12, 2024 at 12:04 AM Paul Moore <paul@paul-moore.com> wrote:
> > >
> > > ...
> > >
> > > > > From a LSM perspective I suspect we are always going to need some sort
> > > > > of hook in the F_SETOWN code path as the LSM needs to potentially
> > > > > capture state/attributes/something-LSM-specific at that
> > > > > context/point-in-time.
> > > >
> > > > The only thing LSMs currently do there is capture state from
> > > > current->cred. So if the VFS takes care of capturing current->cred
> > > > there, we should be able to rip out all the file_set_fowner stuff.
> > > > Something like this (totally untested):
> > >
> > > I've very hesitant to drop the LSM hook from the F_SETOWN path both
> > > because it is reasonable that other LSMs may want to do other things
> > > here,
> >
> > What is an example for other things an LSM might want to do there? As
> > far as I understand, the whole point of this hook is to record the
> > identity of the sender of signals - are you talking about an LSM that
> > might not be storing credentials in struct cred, or something like
> > that?
>
> Sure. The LSM framework is intentionally very vague and limited on
> what restrictions it places on individual LSMs; we want to be able to
> support a wide range of security models and concepts. I view the
> F_SETOWN hook are important because it is a control point that is used
> to set/copy/transfer/whatever security attributes from the current
> process to a file/fd for the purpose of managing signals on the fd.
>
> > > and adding a LSM hook to the kernel, even if it is re-adding a
> > > hook that was previously removed, is a difficult and painful process
> > > with an uncertain outcome.
> >
> > Do you mean that even if the LSM hook ends up with zero users
> > remaining, you'd still want to keep it around in case it's needed
> > again later?
>
> I want the security_file_set_fowner() hook to remain a viable hook for
> capturing the current task's security attributes, regardless of what
> security attributes the LSM is interested in capturing and where those
> attributes are stored.
I don't see the point to keep an unused hook, we could add it back later
if there is a valid use case, but I'll send a v2 without this removal.
next prev parent reply other threads:[~2024-08-12 17:28 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 18:10 [PATCH v2 0/4] Landlock: Signal Scoping Support Tahera Fahimi
2024-08-06 18:10 ` [PATCH v2 1/4] Landlock: Add signal control Tahera Fahimi
2024-08-06 18:56 ` Jann Horn
2024-08-06 21:55 ` Jann Horn
2024-08-07 18:16 ` Mickaël Salaün
2024-08-07 23:36 ` Tahera Fahimi
2024-08-08 1:10 ` Jann Horn
2024-08-08 14:09 ` Mickaël Salaün
2024-08-08 14:42 ` Jann Horn
2024-08-09 10:59 ` Mickaël Salaün
2024-08-09 12:40 ` Mickaël Salaün
2024-08-09 12:45 ` Mickaël Salaün
2024-08-09 12:44 ` Jann Horn
2024-08-09 13:17 ` f_modown and LSM inconsistency (was [PATCH v2 1/4] Landlock: Add signal control) Mickaël Salaün
2024-08-09 14:00 ` Jann Horn
2024-08-09 14:44 ` Christian Brauner
2024-08-11 22:04 ` Paul Moore
2024-08-12 13:09 ` Jann Horn
2024-08-12 14:55 ` Mickaël Salaün
2024-08-12 14:57 ` Paul Moore
2024-08-12 15:06 ` Jann Horn
2024-08-12 16:30 ` Paul Moore
2024-08-12 17:27 ` Mickaël Salaün [this message]
2024-08-12 18:17 ` Paul Moore
2024-08-12 14:49 ` [PATCH] fs,security: Fix file_set_fowner LSM hook inconsistencies Mickaël Salaün
2024-08-12 15:00 ` Paul Moore
2024-08-13 1:32 ` kernel test robot
2024-08-13 1:42 ` kernel test robot
2024-08-13 1:42 ` kernel test robot
2024-08-13 11:44 ` kernel test robot
2024-08-09 13:37 ` [PATCH v2 1/4] Landlock: Add signal control Mickaël Salaün
2024-08-09 13:57 ` Jann Horn
2024-08-06 22:00 ` Tahera Fahimi
2024-08-06 22:55 ` Jann Horn
2024-08-06 18:10 ` [PATCH v2 2/4] selftest/Landlock: Signal restriction tests Tahera Fahimi
2024-08-06 18:10 ` [PATCH v2 3/4] sample/Landlock: Support signal scoping restriction Tahera Fahimi
2024-08-06 18:10 ` [PATCH v2 4/4] Landlock: Document LANDLOCK_SCOPED_SIGNAL Tahera Fahimi
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=20240812.Fie3aCh2eiwi@digikod.net \
--to=mic@digikod.net \
--cc=brauner@kernel.org \
--cc=casey@schaufler-ca.com \
--cc=fahimitahera@gmail.com \
--cc=gnoack@google.com \
--cc=jannh@google.com \
--cc=jmorris@namei.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.com \
--cc=viro@zeniv.linux.org.uk \
/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 NNTP newsgroup(s).