Files
linux/include/uapi/linux
Tahera Fahimi 54a6e6bbf3 landlock: Add signal scoping
Currently, a sandbox process is not restricted to sending a signal (e.g.
SIGKILL) to a process outside the sandbox environment.  The ability to
send a signal for a sandboxed process should be scoped the same way
abstract UNIX sockets are scoped. Therefore, we extend the "scoped"
field in a ruleset with LANDLOCK_SCOPE_SIGNAL to specify that a ruleset
will deny sending any signal from within a sandbox process to its parent
(i.e. any parent sandbox or non-sandboxed processes).

This patch adds file_set_fowner and file_free_security hooks to set and
release a pointer to the file owner's domain. This pointer, fown_domain
in landlock_file_security will be used in file_send_sigiotask to check
if the process can send a signal.

The ruleset_with_unknown_scope test is updated to support
LANDLOCK_SCOPE_SIGNAL.

This depends on two new changes:
- commit 1934b21261 ("file: reclaim 24 bytes from f_owner"): replace
  container_of(fown, struct file, f_owner) with fown->file .
- commit 26f204380a ("fs: Fix file_set_fowner LSM hook
  inconsistencies"): lock before calling the hook.

Signed-off-by: Tahera Fahimi <fahimitahera@gmail.com>
Closes: https://github.com/landlock-lsm/linux/issues/8
Link: https://lore.kernel.org/r/df2b4f880a2ed3042992689a793ea0951f6798a5.1725657727.git.fahimitahera@gmail.com
[mic: Update landlock_get_current_domain()'s return type, improve and
fix locking in hook_file_set_fowner(), simplify and fix sleepable call
and locking issue in hook_file_send_sigiotask() and rebase on the latest
VFS tree, simplify hook_task_kill() and quickly return when not
sandboxed, improve comments, rename LANDLOCK_SCOPED_SIGNAL]
Co-developed-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Mickaël Salaün <mic@digikod.net>
2024-09-16 23:50:52 +02:00
..
2024-04-15 13:42:38 +02:00
2021-01-25 18:44:44 +01:00
2023-05-30 15:20:08 +01:00
2021-11-01 13:36:08 +00:00
2022-08-11 10:31:19 -07:00
2024-08-20 14:02:22 -04:00
2022-06-07 10:20:42 -07:00
2021-11-26 16:48:59 +01:00
2023-01-20 09:33:22 +00:00
2024-04-08 14:10:45 +01:00
2024-06-11 12:57:49 -05:00
2024-09-04 12:54:05 +01:00
2020-07-19 19:20:22 -07:00
2023-03-16 21:20:32 -07:00
2023-09-21 19:22:05 +02:00
2022-08-10 13:49:50 +01:00
2021-02-08 13:01:24 +01:00
2024-05-07 01:35:57 +02:00
2021-11-15 07:53:10 -08:00
2021-06-03 15:31:34 -07:00
2024-05-07 01:35:57 +02:00
2024-04-01 10:49:28 +01:00
2024-08-26 09:37:23 -07:00
2024-08-26 09:37:23 -07:00
2024-06-01 07:28:21 +02:00
2022-09-20 09:13:38 +02:00
2024-09-16 23:50:52 +02:00
2024-08-19 22:36:26 -04:00
2021-03-10 09:34:06 +01:00
2023-12-15 17:01:30 +01:00
2024-09-06 08:31:40 -06:00
2024-09-11 20:44:32 -07:00
2022-09-07 16:46:03 +02:00
2024-08-12 17:50:34 -07:00
2023-11-28 19:05:16 +00:00
2024-05-16 18:14:09 -05:00
2023-12-20 19:26:31 -05:00
2022-11-17 11:04:23 -08:00
2021-01-07 16:17:32 +01:00
2022-09-27 17:29:09 -07:00
2023-06-05 09:36:35 +02:00
2024-02-28 18:47:08 -07:00
2023-12-29 11:58:24 -08:00
2023-03-23 17:25:46 +01:00
2024-04-22 17:07:13 -04:00
2021-06-12 13:16:45 -07:00
2020-07-13 15:32:56 -07:00