[PATCH v2 5/5] landlock: Document FS access rights for pathname UNIX sockets
Günther Noack
gnoack3000 at gmail.com
Sat Jan 10 14:33:02 UTC 2026
Cc: Justin Suess <utilityemal77 at gmail.com>
Cc: Mickaël Salaün <mic at digikod.net>
Signed-off-by: Günther Noack <gnoack3000 at gmail.com>
---
Documentation/userspace-api/landlock.rst | 25 +++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/Documentation/userspace-api/landlock.rst b/Documentation/userspace-api/landlock.rst
index 1d0c2c15c22e..29afde4f7e75 100644
--- a/Documentation/userspace-api/landlock.rst
+++ b/Documentation/userspace-api/landlock.rst
@@ -77,7 +77,10 @@ to be explicit about the denied-by-default access rights.
LANDLOCK_ACCESS_FS_MAKE_SYM |
LANDLOCK_ACCESS_FS_REFER |
LANDLOCK_ACCESS_FS_TRUNCATE |
- LANDLOCK_ACCESS_FS_IOCTL_DEV,
+ LANDLOCK_ACCESS_FS_IOCTL_DEV |
+ LANDLOCK_ACCESS_FS_RESOLVE_UNIX_STREAM |
+ LANDLOCK_ACCESS_FS_RESOLVE_UNIX_DGRAM |
+ LANDLOCK_ACCESS_FS_RESOLVE_UNIX_SEQPACKET,
.handled_access_net =
LANDLOCK_ACCESS_NET_BIND_TCP |
LANDLOCK_ACCESS_NET_CONNECT_TCP,
@@ -127,6 +130,17 @@ version, and only use the available subset of access rights:
/* Removes LANDLOCK_SCOPE_* for ABI < 6 */
ruleset_attr.scoped &= ~(LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET |
LANDLOCK_SCOPE_SIGNAL);
+ __attribute__((fallthrough));
+ case 7:
+ /*
+ * Removes LANDLOCK_ACCESS_FS_RESOLVE_UNIX_STREAM,
+ * LANDLOCK_ACCESS_FS_RESOLVE_UNIX_DGRAM and
+ * LANDLOCK_ACCESS_FS_RESOLVE_UNIX_SEQPACKET for ABI < 8
+ */
+ ruleset_attr.handled_access_fs &=
+ ~(LANDLOCK_ACCESS_FS_RESOLVE_UNIX_STREAM |
+ LANDLOCK_ACCESS_FS_RESOLVE_UNIX_DGRAM |
+ LANDLOCK_ACCESS_FS_RESOLVE_UNIX_SEQPACKET);
}
This enables the creation of an inclusive ruleset that will contain our rules.
@@ -604,6 +618,15 @@ Landlock audit events with the ``LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF``,
sys_landlock_restrict_self(). See Documentation/admin-guide/LSM/landlock.rst
for more details on audit.
+Pathname UNIX sockets (ABI < 8)
+-------------------------------
+
+Starting with the Landlock ABI version 8, it is possible to restrict
+connections to pathname :manpage:`unix(7)` sockets using the new
+``LANDLOCK_ACCESS_FS_RESOLVE_UNIX_STREAM``,
+``LANDLOCK_ACCESS_FS_RESOLVE_UNIX_DGRAM`` and
+``LANDLOCK_ACCESS_FS_RESOLVE_UNIX_SEQPACKET`` rights.
+
.. _kernel_support:
Kernel support
--
2.52.0
More information about the Linux-security-module-archive
mailing list