Linux Security Modules development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] landlock: Clarify namespace and capability permission boundaries
Date: Tue, 01 Dec 2026 19:43:35 +0000	[thread overview]
Message-ID: <sashiko-outbox-244101@kernel.org> (raw)
In-Reply-To: <20261201193814.760891-1-mic@digikod.net>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] landlock: incomplete update of namespace fd-reference wording in
  docs
--

commit b0c0c94c5196be874090a6228b828116a0227e60
Author: Mickaël Salaün <mic@digikod.net>

landlock: Clarify namespace and capability permission boundaries

This commit rewords the capability and namespace restrictions section in
Documentation/userspace-api/landlock.rst to clarify that
LANDLOCK_PERMISSION_NAMESPACE_USE covers namespace creation and
reassociation rather than opening existing namespaces, and describes
capability exercise as an independent check.

Link: https://patch.msgid.link/179566442733.1993761.8053687674090289362@163.com [1]

> diff --git a/Documentation/userspace-api/landlock.rst b/Documentation/userspace-api/landlock.rst
> index 7cc5fde482623..1748267930408 100644
> --- a/Documentation/userspace-api/landlock.rst
> +++ b/Documentation/userspace-api/landlock.rst

[ ... ]

> @@ -525,25 +525,23 @@ rights (``handled_access_*``) or cross-domain scopes (``scoped``), per-category
>  permissions constrain the sandboxed process's own use of these enums; members
>  not allowed by a rule are denied by default.
>  
> -``LANDLOCK_PERMISSION_NAMESPACE_USE`` gates *acquisition of access* to
> -namespaces: creation via :manpage:`unshare(2)` / :manpage:`clone(2)`
> -/ :manpage:`clone3(2)`, entry via :manpage:`setns(2)`, and fd-reference
> -acquisition via :manpage:`open_tree(2)` / :manpage:`fsmount(2)`.  Namespaces
> -the process is already a member of when the domain is enforced are implicitly
> -allowed (the process could not continue running otherwise); rules describe
> -which new namespace types the process may acquire.
> +``LANDLOCK_PERMISSION_NAMESPACE_USE`` restricts which namespace types a
> +process may create or reassociate with.  It covers creation even when the
> +caller does not join the new namespace, but does not restrict opening an
> +existing namespace.  Enforcing this permission does not revoke existing
> +namespace membership.

[Severity: Low]
Should the other occurrences of the "fd-reference acquisition" phrasing in
this document and in the UAPI header kernel-doc (which is included into
this guide) be updated to match?

In Documentation/userspace-api/landlock.rst under "Creating a new ruleset":

  For namespace access-control, we can add rules that allow using specific
  namespace types (see :manpage:`namespaces(7)` for the list of ``CLONE_NEW*``
  values): creating them via :manpage:`unshare(2)` / :manpage:`clone(2)` /
  :manpage:`clone3(2)`, joining them via :manpage:`setns(2)`, or acquiring an fd
  reference via :manpage:`open_tree(2)` / :manpage:`fsmount(2)`.

In Documentation/userspace-api/landlock.rst under "Namespace (ABI < 12)":

  Starting with the Landlock ABI version 12, it is possible to restrict namespace
  use (see :manpage:`namespaces(7)`) across creation (:manpage:`unshare(2)`,
  :manpage:`clone(2)`, :manpage:`clone3(2)`), entry (:manpage:`setns(2)`), and
  fd-reference acquisition (:manpage:`open_tree(2)`, :manpage:`fsmount(2)`) with
  the new ``LANDLOCK_PERMISSION_NAMESPACE_USE`` permission flag and
  ``LANDLOCK_RULE_NAMESPACE`` rule type.

And in include/uapi/linux/landlock.h:

   * - %LANDLOCK_PERMISSION_NAMESPACE_USE: Restrict the use of specific namespace
   *   types: creation (:manpage:`unshare(2)`, :manpage:`clone(2)`,
   *   :manpage:`clone3(2)`), joining (:manpage:`setns(2)`), and acquiring an fd
   *   reference (:manpage:`open_tree(2)`, :manpage:`fsmount(2)`).

Leaving those three passages unchanged keeps the old distinction between
creation and fd-reference acquisition in the same rendered userspace API
guide.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201193814.760891-1-mic@digikod.net?part=1

      reply	other threads:[~2026-12-01 19:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 19:38 [PATCH] landlock: Clarify namespace and capability permission boundaries Mickaël Salaün
2026-12-01 19:43 ` sashiko-bot [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=sashiko-outbox-244101@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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