From: "Mickaël Salaün" <mic@digikod.net>
To: Tingmao Wang <m@maowtm.org>
Cc: "Günther Noack" <gnoack@google.com>,
linux-security-module@vger.kernel.org
Subject: Re: [PATCH] landlock: Add counted_by and fix comment in landlock_ruleset
Date: Mon, 9 Feb 2026 18:28:05 +0100 [thread overview]
Message-ID: <20260209.aexahm7thuoR@digikod.net> (raw)
In-Reply-To: <20260208235449.1124354-1-m@maowtm.org>
Thanks!
On Sun, Feb 08, 2026 at 11:54:48PM +0000, Tingmao Wang wrote:
> For a domain, this array stores the access masks for each layer (of
> which there are num_layers of them). For an unmerged ruleset, we have
> one "layer", and one element in this array. This annotation serves as
> useful documentation.
>
> This also removes a comment saying that num_layers = 0 for unmerged
> rulesets, which is incorrect (it is 1).
>
> Signed-off-by: Tingmao Wang <m@maowtm.org>
> ---
>
> I'm not sure if I should add a Fixes tag, but if I should had, it would
> be ae271c1b14 ("landlock: Add ruleset and domain management").
>
> security/landlock/ruleset.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/security/landlock/ruleset.h b/security/landlock/ruleset.h
> index 9d6dc632684c..7005840ac641 100644
> --- a/security/landlock/ruleset.h
> +++ b/security/landlock/ruleset.h
> @@ -168,8 +168,7 @@ struct landlock_ruleset {
> /**
> * @num_layers: Number of layers that are used in this
> * ruleset. This enables to check that all the layers
> - * allow an access request. A value of 0 identifies a
> - * non-merged ruleset (i.e. not a domain).
> + * allow an access request.
> */
> u32 num_layers;
> /**
> @@ -184,7 +183,8 @@ struct landlock_ruleset {
> * layers are set once and never changed for the
> * lifetime of the ruleset.
> */
> - struct access_masks access_masks[];
> + struct access_masks
> + access_masks[] __counted_by(num_layers);
> };
> };
> };
>
> base-commit: f179e1859c711214412876c57f56f9b0cfb13264
> --
> 2.53.0
>
prev parent reply other threads:[~2026-02-09 17:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-08 23:54 [PATCH] landlock: Add counted_by and fix comment in landlock_ruleset Tingmao Wang
2026-02-09 9:47 ` Günther Noack
2026-02-09 17:28 ` Mickaël Salaün [this message]
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=20260209.aexahm7thuoR@digikod.net \
--to=mic@digikod.net \
--cc=gnoack@google.com \
--cc=linux-security-module@vger.kernel.org \
--cc=m@maowtm.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