From: "Günther Noack" <gnoack3000@gmail.com>
To: "Mickaël Salaün" <mic@digikod.net>
Cc: Alejandro Colomar <alx.manpages@gmail.com>,
Michael Kerrisk <mtk.manpages@gmail.com>,
linux-man@vger.kernel.org
Subject: Re: [PATCH 2/3] landlock.7: Document Landlock ABI v2 (file reparenting; kernel 5.19)
Date: Thu, 23 Feb 2023 10:18:54 +0100 [thread overview]
Message-ID: <Y/cvfmEM1XEL/TPz@galopp> (raw)
In-Reply-To: <1bb1d91c9edd6b4b65b012827aa4f739@mail.infomaniak.com>
On Wed, Feb 22, 2023 at 08:45:28AM +0100, Mickaël Salaün wrote:
> On 2023-02-21T21:50:22.000+01:00, Günther Noack wrote:
> > @@ -242,7 +327,8 @@ attr.handled_access_fs =
> > LANDLOCK_ACCESS_FS_MAKE_SOCK |
> > LANDLOCK_ACCESS_FS_MAKE_FIFO |
> > LANDLOCK_ACCESS_FS_MAKE_BLOCK |
> > - LANDLOCK_ACCESS_FS_MAKE_SYM;
> > + LANDLOCK_ACCESS_FS_MAKE_SYM |
> > + LANDLOCK_ACCESS_FS_REFER;
>
> This code example should now query the Landlock ABI version and mask new access right to make it works with old kernels.
The changes I would have to do are:
- I would *remove* LANDLOCK_ACCESS_FS_REFER from
attr.handled_access_fs, because it is not used in the
LANDLOCK_RULE_PATH_PENEATH and that right is implicit anyway.
- Patch 3/3: I would *keep* LANDLOCK_ACCESS_FS_TRUNCATE in
attr.handled_access_fs.
- Patch 3/3: I would query the ABI version, and mask away the
LANDLOCK_ACCESS_FS_TRUNCATE right in handled_access_fs if the ABI
version is < 3.
Things I don't like yet about this approach are:
* I believe if I were to read that example for the first time, I would
be puzzled when seeing the "truncate" right set in
handled_access_fs, but the "refer" right omitted. This requires
additional explanation.
* It does not really describe what to do if you actually need to
reparent files with the "refer" right in your program. The fallback
logic is simpler in the man page example because "refer" is not
needed in the LANDLOCK_RULE_PATH_BENEATH rule.
At the same time, I feel that the more complicated "refer" fallback
logic might be beyond what would reasonably fit into a man page.
Especially given that many users probably don't need the "refer"
right for their programs.
So my proposal would be to change the example as described in the
three bullet points above, but to point out that users who need
"refer" should refer (ha ha) to the kernel documentation for more
details.
Does that sound reasonable to you?
–-Günther
next prev parent reply other threads:[~2023-02-23 9:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 20:50 [PATCH 1/3] landlock.7: Move the warning about missing features into the CAVEATS section Günther Noack
2023-02-21 20:50 ` [PATCH 2/3] landlock.7: Document Landlock ABI v2 (file reparenting; kernel 5.19) Günther Noack
2023-02-22 7:01 ` Mickaël Salaün
2023-02-23 8:39 ` Günther Noack
2023-02-22 7:36 ` Mickaël Salaün
2023-02-23 8:48 ` Günther Noack
2023-02-25 1:10 ` Alex Colomar
2023-02-25 1:19 ` G. Branden Robinson
2023-02-25 1:29 ` Alex Colomar
2023-02-28 19:46 ` Günther Noack
2023-02-25 1:06 ` Alex Colomar
2023-02-22 7:45 ` Mickaël Salaün
2023-02-23 9:18 ` Günther Noack [this message]
2023-02-24 23:21 ` Alex Colomar
2023-02-28 20:21 ` Günther Noack
2023-02-21 20:50 ` [PATCH 3/3] landlock.7: Document Landlock ABI v3 (file truncation; kernel 6.2) Günther Noack
2023-02-22 8:04 ` Mickaël Salaün
2023-02-23 9:24 ` Günther Noack
2023-02-24 23:31 ` Alex Colomar
2023-02-28 20:29 ` Günther Noack
2023-02-24 23:04 ` [PATCH 1/3] landlock.7: Move the warning about missing features into the CAVEATS section Alex Colomar
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=Y/cvfmEM1XEL/TPz@galopp \
--to=gnoack3000@gmail.com \
--cc=alx.manpages@gmail.com \
--cc=linux-man@vger.kernel.org \
--cc=mic@digikod.net \
--cc=mtk.manpages@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