From: "Günther Noack" <gnoack@google.com>
To: Jeff Xu <jeffxu@chromium.org>
Cc: linux-security-module@vger.kernel.org,
"Mickaël Salaün" <mic@digikod.net>, "Jeff Xu" <jeffxu@google.com>,
"Jorge Lucangeli Obes" <jorgelo@chromium.org>,
"Allen Webb" <allenwebb@google.com>,
"Dmitry Torokhov" <dtor@google.com>,
"Paul Moore" <paul@paul-moore.com>,
"Konstantin Meskhidze" <konstantin.meskhidze@huawei.com>,
"Matt Bobrowski" <repnop@google.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v7 4/9] landlock: Add IOCTL access right
Date: Fri, 8 Dec 2023 11:20:44 +0100 [thread overview]
Message-ID: <ZXLt_GB-3ngyMM2O@google.com> (raw)
In-Reply-To: <CABi2SkXvTdrygc4rNmKBSRT5DRv_FeoX+y26JruBbeX_MwwLTQ@mail.gmail.com>
Hello Jeff!
On Fri, Dec 01, 2023 at 11:51:16AM -0800, Jeff Xu wrote:
> On Fri, Dec 1, 2023 at 6:40 AM Günther Noack <gnoack@google.com> wrote:
> > --- a/security/landlock/limits.h
> > +++ b/security/landlock/limits.h
> > @@ -18,7 +18,10 @@
> > #define LANDLOCK_MAX_NUM_LAYERS 16
> > #define LANDLOCK_MAX_NUM_RULES U32_MAX
> >
> > -#define LANDLOCK_LAST_ACCESS_FS LANDLOCK_ACCESS_FS_TRUNCATE
> > +#define LANDLOCK_LAST_PUBLIC_ACCESS_FS LANDLOCK_ACCESS_FS_IOCTL
>
> iiuc, for the next feature, it only needs to update
> LANDLOCK_LAST_PUBLIC_ACCESS_FS to the new LANDLOCK_ACCESS_FS_ABC here.
> and keep below the same, right ?
>
> > +#define LANDLOCK_MASK_PUBLIC_ACCESS_FS ((LANDLOCK_LAST_PUBLIC_ACCESS_FS << 1) - 1)
> > +
> > +#define LANDLOCK_LAST_ACCESS_FS (LANDLOCK_LAST_PUBLIC_ACCESS_FS << 4)
> maybe add a comment why "<<4" is used ?
I'll add a comment to the section explaining it:
For file system access rights, Landlock distinguishes between the publicly
visible access rights (1 to LANDLOCK_LAST_PUBLIC_ACCESS_FS) and the private
ones which are not exposed to userspace (LANDLOCK_LAST_PUBLIC_ACCESS_FS + 1 to
LANDLOCK_LAST_ACCESS_FS). The private access rights are defined in fs.c.
This should clarify both questions, I hope.
You are correct -- the private access rights in fs.c are defined relative to the
last public access right.
—Günther
next prev parent reply other threads:[~2023-12-08 10:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 14:30 [PATCH v7 0/9] Landlock: IOCTL support Günther Noack
2023-12-01 14:30 ` [PATCH v7 1/9] landlock: Remove remaining "inline" modifiers in .c files Günther Noack
2023-12-01 14:30 ` [PATCH v7 2/9] selftests/landlock: Rename "permitted" to "allowed" in ftruncate tests Günther Noack
2023-12-01 14:30 ` [PATCH v7 3/9] landlock: Optimize the number of calls to get_access_mask slightly Günther Noack
2023-12-01 14:30 ` [PATCH v7 4/9] landlock: Add IOCTL access right Günther Noack
2023-12-01 19:51 ` Jeff Xu
2023-12-08 10:20 ` Günther Noack [this message]
2023-12-08 20:48 ` Jeff Xu
2023-12-01 14:30 ` [PATCH v7 5/9] selftests/landlock: Test IOCTL support Günther Noack
2023-12-01 14:30 ` [PATCH v7 6/9] selftests/landlock: Test IOCTL with memfds Günther Noack
2023-12-01 14:30 ` [PATCH v7 7/9] selftests/landlock: Test ioctl(2) and ftruncate(2) with open(O_PATH) Günther Noack
2023-12-01 14:30 ` [PATCH v7 8/9] samples/landlock: Add support for LANDLOCK_ACCESS_FS_IOCTL Günther Noack
2023-12-01 14:30 ` [PATCH v7 9/9] landlock: Document IOCTL support Günther Noack
2023-12-01 19:55 ` Jeff Xu
2023-12-08 12:47 ` Günther Noack
2023-12-08 21:58 ` Jeff Xu
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=ZXLt_GB-3ngyMM2O@google.com \
--to=gnoack@google.com \
--cc=allenwebb@google.com \
--cc=dtor@google.com \
--cc=jeffxu@chromium.org \
--cc=jeffxu@google.com \
--cc=jorgelo@chromium.org \
--cc=konstantin.meskhidze@huawei.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=paul@paul-moore.com \
--cc=repnop@google.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;
as well as URLs for NNTP newsgroup(s).