Files
linux/include/uapi/linux
Günther Noack 42fc7e6543 landlock: Multithreading support for landlock_restrict_self()
Introduce the LANDLOCK_RESTRICT_SELF_TSYNC flag.  With this flag, a
given Landlock ruleset is applied to all threads of the calling
process, instead of only the current one.

Without this flag, multithreaded userspace programs currently resort
to using the nptl(7)/libpsx hack for multithreaded policy enforcement,
which is also used by libcap and for setuid(2).  Using this
userspace-based scheme, the threads of a process enforce the same
Landlock policy, but the resulting Landlock domains are still
separate.  The domains being separate causes multiple problems:

* When using Landlock's "scoped" access rights, the domain identity is
  used to determine whether an operation is permitted.  As a result,
  when using LANLDOCK_SCOPE_SIGNAL, signaling between sibling threads
  stops working.  This is a problem for programming languages and
  frameworks which are inherently multithreaded (e.g. Go).

* In audit logging, the domains of separate threads in a process will
  get logged with different domain IDs, even when they are based on
  the same ruleset FD, which might confuse users.

Cc: Andrew G. Morgan <morgan@kernel.org>
Cc: John Johansen <john.johansen@canonical.com>
Cc: Paul Moore <paul@paul-moore.com>
Suggested-by: Jann Horn <jannh@google.com>
Signed-off-by: Günther Noack <gnoack@google.com>
Link: https://lore.kernel.org/r/20251127115136.3064948-2-gnoack@google.com
[mic: Fix restrict_self_flags test, clean up Makefile, allign comments,
reduce local variable scope, add missing includes]
Closes: https://github.com/landlock-lsm/linux/issues/2
Signed-off-by: Mickaël Salaün <mic@digikod.net>
2026-02-06 17:54:37 +01:00
..
2024-04-15 13:42:38 +02:00
2021-11-01 13:36:08 +00:00
2022-08-11 10:31:19 -07:00
2025-11-24 21:56:17 +01:00
2021-11-26 16:48:59 +01:00
2025-02-05 13:22:04 +09:00
2023-01-20 09:33:22 +00:00
2024-06-11 12:57:49 -05:00
2026-01-18 11:22:53 -05:00
2025-02-12 02:29:30 +00:00
2025-10-28 22:59:19 +01:00
2025-11-25 19:20:42 -08:00
2025-11-05 08:07:21 -07:00
2025-09-05 09:11:28 +02:00
2025-05-03 12:02:09 +02:00
2022-08-10 13:49:50 +01:00
2025-11-24 17:52:11 +01:00
2025-11-24 17:52:11 +01:00
2024-05-07 01:35:57 +02:00
2025-11-29 21:39:58 +09:00
2021-06-03 15:31:34 -07:00
2024-04-01 10:49:28 +01:00
2024-08-26 09:37:23 -07:00
2025-12-18 21:34:42 -08:00
2025-09-15 14:32:54 +02:00
2024-06-01 07:28:21 +02:00
2024-09-01 20:26:05 -07:00
2022-09-20 09:13:38 +02:00
2024-08-19 22:36:26 -04:00
2025-07-08 12:39:24 +02:00
2023-12-15 17:01:30 +01:00
2025-12-05 23:16:26 +00:00
2024-09-06 08:31:40 -06:00
2022-09-07 16:46:03 +02:00
2024-08-12 17:50:34 -07:00
2026-01-02 13:43:41 -05:00
2025-11-03 17:41:18 +01:00
2023-11-28 19:05:16 +00:00
2025-01-08 13:18:11 +01:00
2026-01-11 06:09:11 -10:00
2025-10-30 14:25:14 +01:00
2025-11-25 19:20:42 -08:00
2023-12-20 19:26:31 -05:00
2025-11-04 08:30:09 +01:00
2025-02-25 18:14:03 -08:00
2025-07-14 18:41:42 -07:00
2022-11-17 11:04:23 -08:00
2025-06-19 14:28:22 +02:00
2025-05-21 13:41:03 +02:00
2025-04-17 12:30:02 +02:00
2023-12-29 11:58:24 -08:00
2023-03-23 17:25:46 +01:00
2025-09-21 17:44:20 -04:00
2025-09-22 09:29:28 +01:00
2025-11-30 18:02:43 -05:00
2025-05-27 10:27:54 -04:00
2025-09-22 09:29:29 +01:00
2021-06-12 13:16:45 -07:00