From: Alejandro Colomar <alx.manpages@gmail.com>
To: "Mickaël Salaün" <mic@digikod.net>,
"Günther Noack" <gnoack3000@gmail.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>, linux-man@vger.kernel.org
Subject: Re: [PATCH v7 1/1] landlock.7: Explain the best-effort fallback mechanism in the example
Date: Tue, 18 Apr 2023 16:24:49 +0200 [thread overview]
Message-ID: <84d7c516-41c2-cac6-b5f4-2348eb7201a9@gmail.com> (raw)
In-Reply-To: <5d90e3b0-1577-7efd-03b8-f94b6e50fbc1@digikod.net>
[-- Attachment #1.1: Type: text/plain, Size: 891 bytes --]
Hi Mickaël,
On 4/17/23 22:45, Mickaël Salaün wrote:
[...]
>> +int abi = landlock_create_ruleset(NULL, 0,
>> + LANDLOCK_CREATE_RULESET_VERSION);
>> +if (abi <= 0) {
>> + /*
>> + * Kernel too old, not compiled with Landlock,
>> + * or Landlock was not enabled at boot time.
>> + */
>> + perror("Giving up \- No Landlock support");
[...]
> As a side note, this syscall and this flag should never return 0, but if
> it does (e.g. because of weird seccomp filter), the errno value might be
> unspecified.
Hmm, good catch, we should test for `== -1`, rather than `< 0`.
Michael Kerrisk explicitly wanted this, and I agree with him, as it makes
the code slightly more readable (explicit).
Cheers,
Alex
--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-04-18 14:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-17 17:25 [PATCH v7 0/1] landlock.7: Explain best-effort fallback in example Günther Noack
2023-04-17 17:25 ` [PATCH v7 1/1] landlock.7: Explain the best-effort fallback mechanism in the example Günther Noack
2023-04-17 20:45 ` Mickaël Salaün
2023-04-18 14:24 ` Alejandro Colomar [this message]
2023-04-19 18:21 ` Günther Noack
2023-04-17 18:50 ` [PATCH v7 0/1] landlock.7: Explain best-effort fallback in example Alejandro 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=84d7c516-41c2-cac6-b5f4-2348eb7201a9@gmail.com \
--to=alx.manpages@gmail.com \
--cc=gnoack3000@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;
as well as URLs for NNTP newsgroup(s).