All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Tingmao Wang <m@maowtm.org>
Cc: "Günther Noack" <gnoack@google.com>,
	"Samasth Norway Ananda" <samasth.norway.ananda@oracle.com>,
	linux-security-module@vger.kernel.org,
	"Tahera Fahimi" <fahimitahera@gmail.com>
Subject: Re: [RFC PATCH 5/5] landlock: Improve the comment for domain_is_scoped
Date: Sun, 28 Dec 2025 19:16:55 +0100	[thread overview]
Message-ID: <20251228.Aephei2aecee@digikod.net> (raw)
In-Reply-To: <06393bc18aee5bc278df5ef31c64a05b742ebc10.1766885035.git.m@maowtm.org>

On Sun, Dec 28, 2025 at 01:27:35AM +0000, Tingmao Wang wrote:
> Currently it is not obvious what "scoped" mean, and the fact that the
> function returns true when access should be denied is slightly surprising
> and in need of documentation.
> 
> Cc: Tahera Fahimi <fahimitahera@gmail.com>
> Signed-off-by: Tingmao Wang <m@maowtm.org>
> ---
> 
> Open to discussion on whether this actually explains it better.
> 
>  security/landlock/task.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/security/landlock/task.c b/security/landlock/task.c
> index bf4ed15a7f01..6dfcc1860d6e 100644
> --- a/security/landlock/task.c
> +++ b/security/landlock/task.c
> @@ -166,15 +166,16 @@ static int hook_ptrace_traceme(struct task_struct *const parent)
>  }
>  
>  /**
> - * domain_is_scoped - Checks if the client domain is scoped in the same
> - *		      domain as the server.
> + * domain_is_scoped - Check if an interaction from a client/sender to a
> + *    server/receiver should be restricted based on scope controls.
>   *
>   * @client: IPC sender domain.
>   * @server: IPC receiver domain.
>   * @scope: The scope restriction criteria.
>   *
> - * Returns: True if the @client domain is scoped to access the @server,
> - * unless the @server is also scoped in the same domain as @client.
> + * Returns: True if the @server is in a different domain from @client, and
> + *    the @client domain is scoped to access the @server (i.e. access
> + *    should be denied).

I removed the "the" and the heading spaces:

  *
- * Returns: True if the @client domain is scoped to access the @server,
- * unless the @server is also scoped in the same domain as @client.
+ * Returns: True if @server is in a different domain from @client, and @client
+ * is scoped to access @server (i.e. access should be denied).
  */


>   */
>  static bool domain_is_scoped(const struct landlock_ruleset *const client,
>  			     const struct landlock_ruleset *const server,
> -- 
> 2.52.0
> 

  reply	other threads:[~2025-12-28 18:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-28  1:27 [PATCH 0/5] Landlock: Test, comment and doc improvements Tingmao Wang
2025-12-28  1:27 ` [PATCH 1/5] selftests/landlock: Fix typo in fs_test Tingmao Wang
2025-12-28  1:27 ` [PATCH 2/5] selftests/landlock: Fix missing semicolon Tingmao Wang
2025-12-28  1:27 ` [PATCH 3/5] Documentation/landlock: Fix missing case for ABI 6 in downgrade example Tingmao Wang
2025-12-28 18:16   ` Mickaël Salaün
2025-12-28  1:27 ` [PATCH 4/5] selftests/landlock: Use scoped_base_variants.h for ptrace_test Tingmao Wang
2025-12-28  1:27 ` [RFC PATCH 5/5] landlock: Improve the comment for domain_is_scoped Tingmao Wang
2025-12-28 18:16   ` Mickaël Salaün [this message]
2025-12-28 18:16 ` [PATCH 0/5] Landlock: Test, comment and doc improvements Mickaël Salaün

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=20251228.Aephei2aecee@digikod.net \
    --to=mic@digikod.net \
    --cc=fahimitahera@gmail.com \
    --cc=gnoack@google.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=m@maowtm.org \
    --cc=samasth.norway.ananda@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.