From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-bc0c.mail.infomaniak.ch (smtp-bc0c.mail.infomaniak.ch [45.157.188.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC2B43EEACB for ; Fri, 2 Oct 2026 12:44:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.157.188.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790945073; cv=none; b=AEthEU85Zgk4sVRR8uz3nL7baWwgGkKYFG6kby8TnN2pmMzBCfNpuLZoJp9AunJlKUhq8CufZ9DKtyvxrR9fxtuyDy2hCufAXnRW4nPlUG/R6wz5q5Bh5HhbSRY44sqoQMYmI07rzet/+L8EVbAiyrW+jzeA7kXDM+IXxit5DLI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790945073; c=relaxed/simple; bh=fCP3y+UyE5wBkErl4gEJ4ImbTskW9pwJqn0xpY9ZXOQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Mjy8Z3R2Ljze70eVQ1QQKA+rC5DZemgFNtshTsPRJMZ1yrDtL/TYAUv/H/GRSy+IpOWv/Nyx3oRZ9+C5hxjegasv0F9+6RLp7rRELbA4hI2kegmQrWD5Cf6Hou7RC8LkVa9thfhuxxNNEhSKUN0ETpg5ohFPA5xECvna1YwbJeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net; spf=pass smtp.mailfrom=digikod.net; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b=K82sV/mt; arc=none smtp.client-ip=45.157.188.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=digikod.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b="K82sV/mt" Received: from smtp-4-0001.mail.infomaniak.ch (unknown [IPv6:2001:1600:7:10::a6c]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4hx7lB5n8LzL2y; Fri, 2 Oct 2026 14:44:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digikod.net; s=20191114; t=1790945062; bh=i7ufAMCOn1n0AGYSKdW4etgQSu8QLJHfHHn4CH4w3bA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K82sV/mt9qG062ApUoEylQZTHBjRviT2vofw1meLxfLbmTfZBD2fOEpQViQVSc3yX SE3KD/SmstMBbZSYvpQgK0WFAlb8sQF8j3Mk/0DDjqQIsSdEqOX6/I7O9N9FeYjViz 7mIHxpEh6Em0Sg9eEKietpvh1Pv4VbTe/mFcewlc= Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4hx7l8733tzDgC; Fri, 2 Oct 2026 14:44:20 +0200 (CEST) From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= To: Christian Brauner , =?UTF-8?q?G=C3=BCnther=20Noack?= , Paul Moore , "Serge E . Hallyn" Cc: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Daniel Durning , Jonathan Corbet , Justin Suess , Lennart Poettering , Mikhail Ivanov , Nicolas Bouchinet , Shervin Oloumi , Tingmao Wang , kernel-team@cloudflare.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [PATCH v4 1/8] landlock: Rename quiet_masks to quiet_access Date: Fri, 2 Oct 2026 14:43:54 +0200 Message-ID: <20261002124409.1277970-2-mic@digikod.net> In-Reply-To: <20261002124409.1277970-1-mic@digikod.net> References: <20261002124409.1277970-1-mic@digikod.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha The base stores the fs/net/scope quiet bitmasks in a struct access_masks field named quiet_masks. A following commit adds the sibling struct permission_masks field quiet_permission for capabilities and namespaces. quiet_masks drops the access category and keeps the type half ("masks"), while quiet_permission keeps the category and drops the type half, so the two read as an inconsistent pair. Rename the base field to quiet_access, giving the symmetric, category-named pair quiet_access/quiet_permission that also matches the UAPI handled_access_*/quiet_access_* naming. This is a no-functional-change rename. Cc: Günther Noack Cc: Tingmao Wang Reviewed-by: Tingmao Wang Signed-off-by: Mickaël Salaün --- Changes since v3: https://patch.msgid.link/20260726161400.3010511-5-mic@digikod.net - Adapt the rename to the split ruleset/domain and logging code. - Add Reviewed-by: Tingmao Wang. Changes since v2: - New patch. --- security/landlock/domain.c | 2 +- security/landlock/domain.h | 4 ++-- security/landlock/log.c | 6 +++--- security/landlock/ruleset.h | 4 ++-- security/landlock/syscalls.c | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/security/landlock/domain.c b/security/landlock/domain.c index 4031b581be07..c66663f8cd8b 100644 --- a/security/landlock/domain.c +++ b/security/landlock/domain.c @@ -479,7 +479,7 @@ landlock_merge_ruleset(struct landlock_domain *const parent, return ERR_PTR(err); #ifdef CONFIG_SECURITY_LANDLOCK_LOG - new_dom->hierarchy->quiet_masks = ruleset->quiet_masks; + new_dom->hierarchy->quiet_access = ruleset->quiet_access; #endif /* CONFIG_SECURITY_LANDLOCK_LOG */ return no_free_ptr(new_dom); diff --git a/security/landlock/domain.h b/security/landlock/domain.h index caa3d19d2c43..03f24382537c 100644 --- a/security/landlock/domain.h +++ b/security/landlock/domain.h @@ -130,10 +130,10 @@ struct landlock_hierarchy { */ log_new_exec : 1; /** - * @quiet_masks: Bitmasks of access that should be quieted (i.e. not + * @quiet_access: Bitmasks of access that should be quieted (i.e. not * logged) if the related object is marked as quiet. */ - struct access_masks quiet_masks; + struct access_masks quiet_access; #endif /* CONFIG_SECURITY_LANDLOCK_LOG */ }; diff --git a/security/landlock/log.c b/security/landlock/log.c index a8578a6f2ce9..3f9ae1bacb23 100644 --- a/security/landlock/log.c +++ b/security/landlock/log.c @@ -436,7 +436,7 @@ is_denial_quieted(const struct landlock_request *const request, if (object_quiet_flag) { const access_mask_t quiet_mask = pick_access_mask_for_request_type( - request->type, youngest_denied->quiet_masks); + request->type, youngest_denied->quiet_access); return (quiet_mask & missing) == missing; } @@ -447,10 +447,10 @@ is_denial_quieted(const struct landlock_request *const request, */ switch (request->type) { case LANDLOCK_REQUEST_SCOPE_SIGNAL: - return !!(youngest_denied->quiet_masks.scope & + return !!(youngest_denied->quiet_access.scope & LANDLOCK_SCOPE_SIGNAL); case LANDLOCK_REQUEST_SCOPE_ABSTRACT_UNIX_SOCKET: - return !!(youngest_denied->quiet_masks.scope & + return !!(youngest_denied->quiet_access.scope & LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET); /* * Leave LANDLOCK_REQUEST_PTRACE and LANDLOCK_REQUEST_FS_CHANGE_TOPOLOGY diff --git a/security/landlock/ruleset.h b/security/landlock/ruleset.h index cf77f1806a95..8ebdd4fa098f 100644 --- a/security/landlock/ruleset.h +++ b/security/landlock/ruleset.h @@ -182,11 +182,11 @@ struct landlock_ruleset { #endif /* CONFIG_TRACEPOINTS */ /** - * @quiet_masks: Stores the quiet flags for an unmerged ruleset. For a + * @quiet_access: Stores the quiet flags for an unmerged ruleset. For a * merged domain, this is stored in each layer's struct * landlock_hierarchy instead. */ - struct access_masks quiet_masks; + struct access_masks quiet_access; /** * @handled_masks: Contains the subset of filesystem and network actions * that are handled by this ruleset. diff --git a/security/landlock/syscalls.c b/security/landlock/syscalls.c index 1d02d57f4c48..17d8e9b7b0c6 100644 --- a/security/landlock/syscalls.c +++ b/security/landlock/syscalls.c @@ -280,9 +280,9 @@ SYSCALL_DEFINE3(landlock_create_ruleset, if (IS_ERR(ruleset)) return PTR_ERR(ruleset); - ruleset->quiet_masks.fs = ruleset_attr.quiet_access_fs; - ruleset->quiet_masks.net = ruleset_attr.quiet_access_net; - ruleset->quiet_masks.scope = ruleset_attr.quiet_scoped; + ruleset->quiet_access.fs = ruleset_attr.quiet_access_fs; + ruleset->quiet_access.net = ruleset_attr.quiet_access_net; + ruleset->quiet_access.scope = ruleset_attr.quiet_scoped; /* * Emits before anon_inode_getfd() installs the file descriptor, while @@ -382,7 +382,7 @@ static int add_rule_path_beneath(struct landlock_ruleset *const ruleset, return -EINVAL; /* Checks for useless quiet flag. */ - if (flags & LANDLOCK_ADD_RULE_QUIET && !ruleset->quiet_masks.fs) + if (flags & LANDLOCK_ADD_RULE_QUIET && !ruleset->quiet_access.fs) return -EINVAL; /* Gets and checks the new rule. */ @@ -423,7 +423,7 @@ static int add_rule_net_port(struct landlock_ruleset *ruleset, return -EINVAL; /* Checks for useless quiet flag. */ - if (flags & LANDLOCK_ADD_RULE_QUIET && !ruleset->quiet_masks.net) + if (flags & LANDLOCK_ADD_RULE_QUIET && !ruleset->quiet_access.net) return -EINVAL; /* Denies inserting a rule with port greater than 65535. */ -- 2.55.0