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 v9 4/5] sample/Landlock: Support abstract unix socket restriction
Date: Mon, 19 Aug 2024 21:47:50 +0200 [thread overview]
Message-ID: <20240819.Ielaingoo8Yi@digikod.net> (raw)
In-Reply-To: <60861c67dab1e1e8cf05ec6bfd9e5ac75d09b63a.1723615689.git.fahimitahera@gmail.com>
On Wed, Aug 14, 2024 at 12:22:22AM -0600, Tahera Fahimi wrote:
> A sandboxer can receive the character "a" as input from the environment
> variable LL_SCOPE to restrict the abstract unix sockets from connecting
> to a process outside its scoped domain.
>
> Example
> =======
> Create an abstract unix socket to listen with socat(1):
> socat abstract-listen:mysocket -
> Create a sandboxed shell and pass the character "a" to LL_SCOPED:
> LL_FS_RO=/ LL_FS_RW=. LL_SCOPED="a" ./sandboxer /bin/bash
> If the sandboxed process tries to connect to the listening socket
> with command "socat - abstract-connect:mysocket", the connection
> will fail.
>
> Signed-off-by: Tahera Fahimi <fahimitahera@gmail.com>
> ---
> @@ -358,6 +403,11 @@ int main(const int argc, char *const argv[], char *const *const envp)
> ~LANDLOCK_ACCESS_NET_CONNECT_TCP;
> }
>
> + if (abi >= 6 && !check_ruleset_scope(ENV_SCOPED_NAME, &ruleset_attr)) {
> + perror("Unsupported IPC scoping requested");
If LL_SCOPE="", the sandboxer prints:
"Unsupported IPC scoping requested: Success"
> + return 1;
> + }
> +
> ruleset_fd =
> landlock_create_ruleset(&ruleset_attr, sizeof(ruleset_attr), 0);
> if (ruleset_fd < 0) {
> --
> 2.34.1
>
>
next prev parent reply other threads:[~2024-08-19 19:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 6:22 [PATCH v9 0/5] Landlock: Add abstract unix socket connect restriction Tahera Fahimi
2024-08-14 6:22 ` [PATCH v9 1/5] " Tahera Fahimi
2024-08-16 21:19 ` Mickaël Salaün
2024-08-19 15:37 ` Mickaël Salaün
2024-08-19 22:20 ` Tahera Fahimi
2024-08-20 15:56 ` Mickaël Salaün
2024-08-19 19:35 ` Mickaël Salaün
2024-08-14 6:22 ` [PATCH v9 2/5] selftests/Landlock: Abstract unix socket restriction tests Tahera Fahimi
2024-08-16 21:23 ` Mickaël Salaün
2024-08-16 23:08 ` Tahera Fahimi
2024-08-19 15:38 ` Mickaël Salaün
2024-08-19 15:42 ` Mickaël Salaün
2024-08-19 19:55 ` Tahera Fahimi
2024-08-14 6:22 ` [PATCH v9 3/5] selftests/Landlock: Adding pathname Unix socket tests Tahera Fahimi
2024-08-19 19:47 ` Mickaël Salaün
2024-08-14 6:22 ` [PATCH v9 4/5] sample/Landlock: Support abstract unix socket restriction Tahera Fahimi
2024-08-19 19:47 ` Mickaël Salaün [this message]
2024-08-14 6:22 ` [PATCH v9 5/5] Landlock: Document LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET and ABI versioning Tahera Fahimi
2024-08-19 19:49 ` Mickaël Salaün
2024-08-19 19:58 ` [PATCH v9 0/5] Landlock: Add abstract unix socket connect restriction Mickaël Salaün
2024-08-19 20:16 ` 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=20240819.Ielaingoo8Yi@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).