diff options
| author | Mickaël Salaün <mic@digikod.net> | 2026-11-18 15:52:10 +0100 |
|---|---|---|
| committer | Mickaël Salaün <mic@digikod.net> | 2026-11-19 11:55:32 +0100 |
| commit | c0aa8acdd94e9ec0ea2fefe8fa5b31c03c271c4b (patch) | |
| tree | 40468417984fc0978c270caa3607b6b2cb5faf01 | |
| parent | 2c709fccbac59ac66774ef06b4bff56eab9311c0 (diff) | |
landlock: Fix capability restriction documentation
Some documented claims about LANDLOCK_PERMISSION_CAPABILITY_USE do not
hold for every capability check. Remove them instead of listing their
exceptions, and stop calling this permission a hook.
Cc: Günther Noack <gnoack@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Serge Hallyn <serge@hallyn.com>
Acked-by: Serge Hallyn (AMD) <sergeh@kernel.org>
Reviewed-by: Günther Noack <gnoack@google.com>
Fixes: 97c8386f1d74 ("landlock: Enforce capability restrictions")
Link: https://patch.msgid.link/20261118145217.2551053-7-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
| -rw-r--r-- | Documentation/security/landlock.rst | 8 | ||||
| -rw-r--r-- | Documentation/userspace-api/landlock.rst | 8 | ||||
| -rw-r--r-- | include/uapi/linux/landlock.h | 7 |
3 files changed, 11 insertions, 12 deletions
diff --git a/Documentation/security/landlock.rst b/Documentation/security/landlock.rst index d81f1c2cd236..98c2e7139e8d 100644 --- a/Documentation/security/landlock.rst +++ b/Documentation/security/landlock.rst @@ -8,7 +8,7 @@ Landlock LSM: kernel documentation ================================== :Author: Mickaël Salaün -:Date: October 2026 +:Date: November 2026 Landlock's goal is to create scoped access-control (i.e. sandboxing). To harden a whole system, this feature should be available to any process, @@ -359,9 +359,9 @@ framework in ``log.c``, compiled under ``CONFIG_SECURITY_LANDLOCK_LOG`` (automatically selected by ``CONFIG_AUDIT`` or ``CONFIG_TRACEPOINTS``). Audit records respect audit configuration, the domain's Landlock log -flags, and ``LANDLOCK_LOG_DISABLED``. Tracepoints fire unconditionally, -independent of these settings. The denial counter (``num_denials``) is -always incremented regardless of logging configuration. +flags, and ``LANDLOCK_LOG_DISABLED``. Tracepoints fire independently of +these settings. The denial counter (``num_denials``) is +incremented regardless of logging configuration. Each denial tracepoint carries a ``logged`` field reporting the audit-logging verdict: whether the denial would be written to the audit diff --git a/Documentation/userspace-api/landlock.rst b/Documentation/userspace-api/landlock.rst index 24cfc2c23cb2..7cc5fde48262 100644 --- a/Documentation/userspace-api/landlock.rst +++ b/Documentation/userspace-api/landlock.rst @@ -8,7 +8,7 @@ Landlock: unprivileged access control ===================================== :Author: Mickaël Salaün -:Date: October 2026 +:Date: November 2026 The goal of Landlock is to enable restriction of ambient rights (e.g. global filesystem or network access) for a set of processes. Because Landlock @@ -532,7 +532,7 @@ 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_CAPABILITY_USE`` gates every exercise of a capability +``LANDLOCK_PERMISSION_CAPABILITY_USE`` gates the exercise of capabilities after the domain is enforced, regardless of how the capability was obtained (inherited credentials, ``CLONE_NEWUSER`` grant, ``setuid``/file-cap-bearing :manpage:`execve(2)`, etc.). Configuring @@ -641,9 +641,9 @@ after a domain is enforced through user namespace entry or :manpage:`capset(2)`; privileged sandboxes that did not set ``PR_SET_NO_NEW_PRIVS`` may also gain capabilities through :manpage:`execve(2)` of binaries with file capabilities. In all cases, :manpage:`capget(2)` will report the credential's capability sets, -but any denied capability will fail with ``EPERM`` when exercised. Do not rely +but any denied capability will fail when exercised. Do not rely on :manpage:`capget(2)` to determine whether the policy permits a given -capability; only the actual operation will return ``EPERM`` upon denial. +capability. Truncating files ---------------- diff --git a/include/uapi/linux/landlock.h b/include/uapi/linux/landlock.h index 7e38b9d1bf12..8ce0406ba543 100644 --- a/include/uapi/linux/landlock.h +++ b/include/uapi/linux/landlock.h @@ -623,10 +623,9 @@ struct landlock_capability_attr { * - %LANDLOCK_PERMISSION_CAPABILITY_USE: Restrict the use of specific Linux * capabilities. A process in a Landlock domain that handles this permission * is denied from exercising capabilities that are not explicitly allowed by a - * %LANDLOCK_RULE_CAPABILITY rule. This hook is purely restrictive: it can - * deny capabilities that the kernel would otherwise grant, but it can never - * grant capabilities that the kernel already denied. Support added in - * Landlock ABI version 12. + * %LANDLOCK_RULE_CAPABILITY rule. Landlock only reduces the capabilities + * that processes can use: it does not let them use capabilities that they + * would not have without Landlock. Support added in Landlock ABI version 12. */ #define LANDLOCK_PERMISSION_NAMESPACE_USE (1ULL << 0) #define LANDLOCK_PERMISSION_CAPABILITY_USE (1ULL << 1) |
