From: Tahera Fahimi <fahimitahera@gmail.com>
To: outreachy@lists.linux.dev
Cc: mic@digikod.net, gnoack@google.com, paul@paul-moore.com,
jmorris@namei.org, serge@hallyn.com,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org, bjorn3_gh@protonmail.com,
jannh@google.com, netdev@vger.kernel.org,
Tahera Fahimi <fahimitahera@gmail.com>
Subject: [PATCH v3 0/6] Landlock: Signal Scoping Support
Date: Thu, 15 Aug 2024 12:29:19 -0600 [thread overview]
Message-ID: <cover.1723680305.git.fahimitahera@gmail.com> (raw)
This patch series adds scoping mechanism for signals.
Closes: https://github.com/landlock-lsm/linux/issues/8
Problem
=======
A sandboxed process is currently not restricted from sending signals
(e.g. SIGKILL) to processes outside the sandbox since Landlock has
no restriction on signals(see more details in [1]).
A simple way to apply this restriction would be to scope signals the
same way abstract unix sockets are restricted.
[1]https://lore.kernel.org/all/20231023.ahphah4Wii4v@digikod.net/
Solution
========
To solve this issue, we extend the "scoped" field in the Landlock
ruleset attribute structure by introducing "LANDLOCK_SCOPED_SIGNAL"
field to specify that a ruleset will deny sending any signals from
within the sandbox domain to its parent(i.e. any parent sandbox or
non-sandbox processes).
Example
=======
Create a sansboxed shell and pass the character "s" to LL_SCOPED:
LL_FD_RO=/ LL_FS_RW=. LL_SCOPED="s" ./sandboxer /bin/bash
Try to send a signal(like SIGTRAP) to a process ID <PID> through:
kill -SIGTRAP <PID>
The sandboxed process should not be able to send the signal.
Previous Versions
=================
v2:https://lore.kernel.org/all/cover.1722966592.git.fahimitahera@gmail.com/
v1:https://lore.kernel.org/all/cover.1720203255.git.fahimitahera@gmail.com/
Tahera Fahimi (6):
Landlock: Add signal control
Landlock: Adding file_send_sigiotask signal scoping support
selftest/Landlock: Signal restriction tests
selftest/Landlock: pthread_kill(3) tests
sample/Landlock: Support signal scoping restriction
Landlock: Document LANDLOCK_SCOPED_SIGNAL
Documentation/userspace-api/landlock.rst | 25 +-
include/uapi/linux/landlock.h | 3 +
samples/landlock/sandboxer.c | 16 +-
security/landlock/fs.c | 18 +
security/landlock/fs.h | 6 +
security/landlock/limits.h | 2 +-
security/landlock/task.c | 54 +++
.../selftests/landlock/scoped_signal_test.c | 331 ++++++++++++++++++
8 files changed, 443 insertions(+), 12 deletions(-)
create mode 100644 tools/testing/selftests/landlock/scoped_signal_test.c
--
2.34.1
next reply other threads:[~2024-08-15 18:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-15 18:29 Tahera Fahimi [this message]
2024-08-15 18:29 ` [PATCH v3 1/6] Landlock: Add signal control Tahera Fahimi
2024-08-15 18:29 ` [PATCH v3 2/6] Landlock: Adding file_send_sigiotask signal scoping support Tahera Fahimi
2024-08-15 20:25 ` Jann Horn
2024-08-15 21:28 ` Tahera Fahimi
2024-08-15 22:10 ` Jann Horn
2024-08-15 23:06 ` Tahera Fahimi
2024-08-19 17:57 ` Mickaël Salaün
2024-08-21 10:13 ` Mickaël Salaün
2024-08-15 18:29 ` [PATCH v3 3/6] selftest/Landlock: Signal restriction tests Tahera Fahimi
2024-08-20 15:57 ` Mickaël Salaün
2024-08-26 12:40 ` Mickaël Salaün
2024-08-15 18:29 ` [PATCH v3 4/6] selftest/Landlock: pthread_kill(3) tests Tahera Fahimi
2024-08-20 15:57 ` Mickaël Salaün
2024-08-26 12:40 ` Mickaël Salaün
2024-08-15 18:29 ` [PATCH v3 5/6] sample/Landlock: Support signal scoping restriction Tahera Fahimi
2024-08-15 18:29 ` [PATCH v3 6/6] Landlock: Document LANDLOCK_SCOPED_SIGNAL Tahera Fahimi
2024-08-15 21:07 ` Tahera Fahimi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1723680305.git.fahimitahera@gmail.com \
--to=fahimitahera@gmail.com \
--cc=bjorn3_gh@protonmail.com \
--cc=gnoack@google.com \
--cc=jannh@google.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=netdev@vger.kernel.org \
--cc=outreachy@lists.linux.dev \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).