From bd3a19800dd1ba1ba9a4c307d9dfe50eac443c01 Mon Sep 17 00:00:00 2001 From: Tingmao Wang Date: Sun, 8 Feb 2026 23:54:48 +0000 Subject: [PATCH] landlock: Add counted_by in landlock_domain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For a domain, this array stores the access masks for each layer (of which there are num_layers of them). This annotation serves as useful documentation. Signed-off-by: Tingmao Wang Reviewed-by: Günther Noack Link: https://patch.msgid.link/20260208235449.1124354-1-m@maowtm.org [mic: Rebase on the ruleset/domain split, and update commit message] Signed-off-by: Mickaël Salaün --- security/landlock/domain.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/landlock/domain.h b/security/landlock/domain.h index 5ce2f91488d5..caa3d19d2c43 100644 --- a/security/landlock/domain.h +++ b/security/landlock/domain.h @@ -243,7 +243,8 @@ struct landlock_domain { * overlapping access rights. These layers are set once * and never changed for the lifetime of the domain. */ - struct access_masks handled_masks[]; + struct access_masks + handled_masks[] __counted_by(num_layers); }; }; };