[PATCH 4/4] landlock: Document namespace denial operations

From
Mickaël Salaün <mic@digikod.net>
Date
2026-11-17 10:21:27
Also in
linux-security-module
Reply to
Mickaël Salaün, 2026-11-17
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
Thread (5 messages) 5 messages, 1 author, last reply 8h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help