From: "Günther Noack" <gnoack3000@gmail.com>
To: "Mickaël Salaün" <mic@digikod.net>
Cc: Paul Moore <paul@paul-moore.com>,
James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
Konstantin Meskhidze <konstantin.meskhidze@huawei.com>,
Shuah Khan <shuah@kernel.org>, Dwi Siswanto <me@dw1.io>,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v2 3/4] landlock: Simplify landlock_get_fs_access_mask()
Date: Fri, 13 Nov 2026 20:44:44 +0100 [thread overview]
Message-ID: <20261113.a18c311fd502@gnoack.org> (raw)
In-Reply-To: <20261113.ojir0eich9Ja@digikod.net>
On Fri, Nov 13, 2026 at 12:25:36AM +0100, Mickaël Salaün wrote:
> On Sun, Nov 08, 2026 at 09:23:50PM +0100, Günther Noack wrote:
> > Return the handled FS access mask as it is, instead of artificially
> > adding LANDLOCK_ACCESS_FS_REFER to it.
> >
> > Since commit d6c7cf84a24f ("landlock: Simplify initially denied access
> > rights"), the merge operation already bakes the initially denied
> > access rights (LANDLOCK_ACCESS_FS_REFER) into the a layer's handled FS
> > access rights. -- They don't need to be added explicitly any more.
> >
> > No functional change.
> >
> > Signed-off-by: Günther Noack <gnoack3000@gmail.com>
> > ---
> > security/landlock/domain.h | 12 ++++--------
> > 1 file changed, 4 insertions(+), 8 deletions(-)
> >
> > diff --git a/security/landlock/domain.h b/security/landlock/domain.h
> > index d9ebf4857fce..812c324cb6ef 100644
> > --- a/security/landlock/domain.h
> > +++ b/security/landlock/domain.h
> > @@ -262,16 +262,12 @@ static inline access_mask_t
> > landlock_get_fs_access_mask(const struct landlock_domain *const domain,
> > const u16 layer_level)
> > {
> > - access_mask_t handled = domain->layers[layer_level].handled.fs;
> > -
> > /*
> > - * Handles all initially denied by default access rights, but only for
> > - * layers handling filesystem accesses.
> > + * Initially denied by default access rights are already included for
> > + * layers handling filesystem accesses, see
> > + * landlock_upgrade_handled_layer_config().
> > */
> > - if (handled)
> > - handled |= _LANDLOCK_ACCESS_FS_INITIALLY_DENIED;
> > -
> > - return handled;
> > + return domain->layers[layer_level].handled.fs;
>
> Could we add a small companion KUnit test to make sure the semantic
> doesn't change?
Sounds good, I'll add one.
I'm running under the assumption that what you mean here is a test
that covers both the upgrade function and
landlock_get_fs_access_mask(), so that that KUnit test keeps working
in both versions of the change. I'll stack it as a separate commit
after the first of the two changes to landlock_get_fs_access_mask().
–Günther
next prev parent reply other threads:[~2026-11-13 19:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 20:23 [PATCH v2 0/4] landlock: Fix REFER in layered domains Günther Noack
2026-11-08 20:23 ` [PATCH v2 1/4] landlock: Fix layer composition of LANDLOCK_ACCESS_FS_REFER Günther Noack
2026-11-12 23:25 ` Mickaël Salaün
2026-11-13 15:15 ` Günther Noack
2026-11-08 20:23 ` [PATCH v2 2/4] selftests/landlock: Test that layering does not break refer Günther Noack
2026-11-12 23:25 ` Mickaël Salaün
2026-11-08 20:23 ` [PATCH v2 3/4] landlock: Simplify landlock_get_fs_access_mask() Günther Noack
2026-11-12 23:25 ` Mickaël Salaün
2026-11-13 19:44 ` Günther Noack [this message]
2026-11-08 20:23 ` [PATCH v2 4/4] landlock: Clarify implicit handling of LANDLOCK_ACCESS_FS_REFER Günther Noack
2026-11-12 23:28 ` Mickaël Salaün
2026-11-13 18:39 ` Günther Noack
2026-11-12 23:24 ` [PATCH v2 0/4] landlock: Fix REFER in layered domains Mickaël Salaün
2026-11-13 20:16 ` Günther Noack
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=20261113.a18c311fd502@gnoack.org \
--to=gnoack3000@gmail.com \
--cc=jmorris@namei.org \
--cc=konstantin.meskhidze@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=me@dw1.io \
--cc=mic@digikod.net \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.com \
--cc=shuah@kernel.org \
/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