From: "Mickaël Salaün" <mic@digikod.net>
To: "Günther Noack" <gnoack@google.com>
Cc: "Mickaël Salaün" <mic@digikod.net>,
"Christian Brauner" <brauner@kernel.org>,
"Eric Paris" <eparis@redhat.com>,
"Masami Hiramatsu" <mhiramat@kernel.org>,
"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
"Paul Moore" <paul@paul-moore.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
audit@vger.kernel.org, linux-security-module@vger.kernel.org,
linux-trace-kernel@vger.kernel.org
Subject: [PATCH 4/4] landlock: Document namespace denial operations
Date: Tue, 17 Nov 2026 11:21:07 +0100 [thread overview]
Message-ID: <20261117102110.2524197-5-mic@digikod.net> (raw)
In-Reply-To: <20261117102110.2524197-1-mic@digikod.net>
Namespace denial records now distinguish creation from entry. Document
the namespace_op field in the audit and trace references, and clarify
that it describes the semantic namespace hook rather than exact syscall
provenance.
Creation reports the ID allocated for a namespace that never becomes
reachable, whereas entry reports the existing target ID.
Cc: Günther Noack <gnoack@google.com>
Signed-off-by: Mickaël Salaün <mic@digikod.net>
---
Documentation/admin-guide/LSM/landlock.rst | 21 ++++++++++++---------
Documentation/trace/events-landlock.rst | 20 +++++++++++++-------
2 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/Documentation/admin-guide/LSM/landlock.rst b/Documentation/admin-guide/LSM/landlock.rst
index 946f3bf89650..a79912e8a684 100644
--- a/Documentation/admin-guide/LSM/landlock.rst
+++ b/Documentation/admin-guide/LSM/landlock.rst
@@ -7,7 +7,7 @@ Landlock: system-wide management
================================
:Author: Mickaël Salaün
-:Date: October 2026
+:Date: November 2026
Landlock can leverage the audit framework to log events.
@@ -72,10 +72,13 @@ AUDIT_LANDLOCK_ACCESS
:manpage:`unshare(2)`, :manpage:`clone(2)`, :manpage:`clone3(2)`,
:manpage:`open_tree(2)`, or :manpage:`fsmount(2)`, or joining via
:manpage:`setns(2)`);
- ``namespace_type`` indicates the type (hex ``CLONE_NEW*`` bitmask),
- and ``namespace_id`` identifies the target namespace (for a denied
- creation, the namespace never becomes reachable so its ID is not
- directly visible from user space)
+ ``namespace_op`` is ``create`` for construction or ``enter`` for
+ :manpage:`setns(2)`. These values describe semantic namespace hooks,
+ not exact system calls. ``namespace_type`` indicates the type (hex
+ ``CLONE_NEW*`` bitmask), and ``namespace_id`` identifies the namespace
+ object. For a denied creation, the new namespace never becomes
+ reachable, so its ID is not directly visible from user space. For a
+ denied entry, this is the exact existing target ID.
**capability.*** - Capability restrictions (ABI 12+):
- capability.use - Capability use was denied;
@@ -86,10 +89,10 @@ AUDIT_LANDLOCK_ACCESS
in a directory that lacks both ``make_reg`` and ``refer`` rights would show
``blockers=fs.make_reg,fs.refer``.
- The object identification fields depend on the type of access being blocked:
- ``path``, ``dev``, ``ino`` for filesystem; ``opid``, ``ocomm`` for signals;
- ``namespace_type`` and ``namespace_id`` for namespace operations;
- ``capability`` for capability use.
+ The operation and object context fields depend on the type of access being
+ blocked: ``path``, ``dev``, ``ino`` for filesystem; ``opid``, ``ocomm`` for
+ signals; ``namespace_op``, ``namespace_type``, and ``namespace_id`` for
+ namespace operations; ``capability`` for capability use.
AUDIT_LANDLOCK_DOMAIN
diff --git a/Documentation/trace/events-landlock.rst b/Documentation/trace/events-landlock.rst
index dc5f05a17c2c..b94ffa42678b 100644
--- a/Documentation/trace/events-landlock.rst
+++ b/Documentation/trace/events-landlock.rst
@@ -6,7 +6,7 @@ Landlock Trace Events
=====================
:Author: Mickaël Salaün
-:Date: October 2026
+:Date: November 2026
Landlock emits trace events for sandbox lifecycle operations and access
denials. These events can be consumed by ftrace (for human-readable
@@ -186,13 +186,19 @@ known allowed and quiet member masks. Capability masks and the raw
therefore appears as zero while still advancing the ruleset version, and adding
a member already present still emits an event.
-``landlock_deny_permission_namespace`` reports the denied raw
-``CLONE_NEW*`` value. ``namespace_id`` is the exact target namespace ID. For
-a denied namespace creation, the namespace never becomes reachable so its ID
-is not directly visible from user space.
+``landlock_deny_permission_namespace`` reports ``namespace_op`` as ``create``
+for namespace construction, for example through :manpage:`clone(2)`,
+:manpage:`clone3(2)`, :manpage:`unshare(2)`, :manpage:`open_tree(2)`, or
+:manpage:`fsmount(2)`, and ``enter`` for :manpage:`setns(2)`. These values
+describe the semantic namespace hook, not the exact system call.
+``namespace_type`` is the denied raw ``CLONE_NEW*`` value. For a denied
+creation, ``namespace_id`` is allocated for the new namespace, which never
+becomes reachable, so its ID is not directly visible from user space. For a
+denied entry, ``namespace_id`` is the exact existing target ID.
+
``landlock_deny_permission_capability`` reports the denied ``CAP_*`` number.
-Like every denial event, both include the denying domain, ``same_exec``, and
-``logged``.
+Like every denial event, the namespace and capability events include the
+denying domain, ``same_exec``, and ``logged``.
Per-member quiet masks suppress audit submission but never these trace events,
which report ``logged=0``.
--
2.56.0
prev parent reply other threads:[~2026-11-17 10:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 10:21 [PATCH 0/4] Landlock: Fix namespace and capability denials Mickaël Salaün
2026-11-17 10:21 ` [PATCH 1/4] landlock: Distinguish namespace creation and entry denials Mickaël Salaün
2026-11-17 10:21 ` [PATCH 2/4] landlock: Add capability objects to denial tracing Mickaël Salaün
2026-11-17 10:21 ` [PATCH 3/4] selftests/landlock: Test namespace denial operations Mickaël Salaün
2026-11-17 10:21 ` 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=20261117102110.2524197-5-mic@digikod.net \
--to=mic@digikod.net \
--cc=audit@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=eparis@redhat.com \
--cc=gnoack@google.com \
--cc=linux-security-module@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=paul@paul-moore.com \
--cc=rostedt@goodmis.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