From: "Mickaël Salaün" <mic@digikod.net>
To: Tahera Fahimi <fahimitahera@gmail.com>
Cc: outreachy@lists.linux.dev, 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
Subject: Re: [PATCH v4 6/6] landlock: Document LANDLOCK_SCOPED_SIGNAL
Date: Fri, 13 Sep 2024 17:07:16 +0200 [thread overview]
Message-ID: <20240913.Peiy9EighahZ@digikod.net> (raw)
In-Reply-To: <dae0dbe1a78be2ce5506b90fc4ffd12c82fa1061.1725657728.git.fahimitahera@gmail.com>
On Fri, Sep 06, 2024 at 03:30:08PM -0600, Tahera Fahimi wrote:
> Improving Landlock ABI version 6 to support signal scoping with
> LANDLOCK_SCOPED_SIGNAL.
>
> Signed-off-by: Tahera Fahimi <fahimitahera@gmail.com>
> ---
> v3:
> - update date
> ---
> Documentation/userspace-api/landlock.rst | 22 +++++++++++++++-------
> 1 file changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/userspace-api/landlock.rst b/Documentation/userspace-api/landlock.rst
> index c3b87755e98d..c694e9fe36fc 100644
> --- a/Documentation/userspace-api/landlock.rst
> +++ b/Documentation/userspace-api/landlock.rst
> @@ -82,7 +82,8 @@ to be explicit about the denied-by-default access rights.
> LANDLOCK_ACCESS_NET_BIND_TCP |
> LANDLOCK_ACCESS_NET_CONNECT_TCP,
> .scoped =
> - LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET,
> + LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET |
> + LANDLOCK_SCOPED_SIGNAL,
> };
>
> Because we may not know on which kernel version an application will be
> @@ -123,7 +124,8 @@ version, and only use the available subset of access rights:
> ruleset_attr.handled_access_fs &= ~LANDLOCK_ACCESS_FS_IOCTL_DEV;
> case 5:
> /* Removes LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET for ABI < 6 */
> - ruleset_attr.scoped &= ~LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET;
> + ruleset_attr.scoped &= ~(LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET |
> + LANDLOCK_SCOPED_SIGNAL);
> }
>
> This enables to create an inclusive ruleset that will contain our rules.
> @@ -320,11 +322,15 @@ explicitly scoped for a set of actions by specifying it on a ruleset.
> For example, if a sandboxed process should not be able to
> :manpage:`connect(2)` to a non-sandboxed process through abstract
> :manpage:`unix(7)` sockets, we can specify such restriction with
> -``LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET``.
> +``LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET``. Moreover, if a sandboxed
> +process should not be able to send a signal to a non-sandboxed process,
> +we can specify this restriction with ``LANDLOCK_SCOPED_SIGNAL``.
>
> A sandboxed process can connect to a non-sandboxed process when its
> domain is not scoped. If a process's domain is scoped, it can only
> connect to sockets created by processes in the same scoped domain.
> +Moreover, If a process is scoped to send signal to a non-scoped process,
> +it can only send signals to processes in the same scoped domain.
>
> A connected datagram socket behaves like a stream socket when its domain
> is scoped, meaning if the domain is scoped after the socket is connected
> @@ -575,12 +581,14 @@ earlier ABI.
> Starting with the Landlock ABI version 5, it is possible to restrict the use of
> :manpage:`ioctl(2)` using the new ``LANDLOCK_ACCESS_FS_IOCTL_DEV`` right.
>
> -Abstract UNIX sockets Restriction (ABI < 6)
> ---------------------------------------------
> +Abstract Unix sockets and Signal Restriction (ABI < 6)
> +-------------------------------------------------------
I created a dedicated section instead of merging both.
>
> +<<<<<<< current
I fixed that.
> With ABI version 6, it is possible to restrict connection to an abstract
> -Unix socket through ``LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET``, thanks to
> -the ``scoped`` ruleset attribute.
> +:manpage:`unix(7)` socket through
> +``LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET`` and sending signal through
> +``LANDLOCK_SCOPED_SIGNAL``, thanks to the ``scoped`` ruleset attribute.
I cleaned up this fix that should be part of the other series.
>
> .. _kernel_support:
>
> --
> 2.34.1
>
>
next prev parent reply other threads:[~2024-09-13 15:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-06 21:30 [PATCH v4 0/6] landlock: Signal scoping support Tahera Fahimi
2024-09-06 21:30 ` [PATCH v4 1/6] landlock: Add signal scoping control Tahera Fahimi
2024-09-13 15:07 ` Mickaël Salaün
2024-09-06 21:30 ` [PATCH v4 2/6] selftest/landlock: Signal restriction tests Tahera Fahimi
2024-09-06 21:30 ` [PATCH v4 3/6] selftest/landlock: Add signal_scoping_threads test Tahera Fahimi
2024-09-06 21:30 ` [PATCH v4 4/6] selftest/landlock: Test file_send_sigiotask by sending out-of-bound message Tahera Fahimi
2024-09-09 10:32 ` Mickaël Salaün
2024-09-06 21:30 ` [PATCH v4 5/6] sample/landlock: Support sample for signal scoping restriction Tahera Fahimi
2024-09-06 21:30 ` [PATCH v4 6/6] landlock: Document LANDLOCK_SCOPED_SIGNAL Tahera Fahimi
2024-09-13 15:07 ` Mickaël Salaün [this message]
2024-09-11 18:17 ` [PATCH v4 0/6] landlock: Signal scoping support Mickaël Salaün
2024-09-12 0:15 ` Tahera Fahimi
2024-09-12 12:51 ` Mickaël Salaün
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=20240913.Peiy9EighahZ@digikod.net \
--to=mic@digikod.net \
--cc=bjorn3_gh@protonmail.com \
--cc=fahimitahera@gmail.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=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).