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 3/5] selftests/Landlock: Adding pathname Unix socket tests
Date: Mon, 19 Aug 2024 21:47:23 +0200 [thread overview]
Message-ID: <20240819.Ohph6ahphohH@digikod.net> (raw)
In-Reply-To: <df1c54690beeab024534f6671ee9a3266270d9e1.1723615689.git.fahimitahera@gmail.com>
On Wed, Aug 14, 2024 at 12:22:21AM -0600, Tahera Fahimi wrote:
> This patch expands abstract Unix socket restriction tests by
> testing pathname sockets connection with scoped domain.
>
> pathname_address_sockets ensures that Unix sockets bound to
> a null-terminated filesystem can still connect to a socket
"bound to a filesystem path name"
> outside of their scoped domain. This means that even if the
> domain is scoped with LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET,
> the socket can connect to a socket outside the scoped domain.
>
> Signed-off-by: Tahera Fahimi <fahimitahera@gmail.com>
> ---
> changes in versions:
> v9:
> - Moving remove_path() back to fs_test.c, and using unlink(2)
> and rmdir(2) instead.
> - Removing hard-coded numbers and using "backlog" instead.
> V8:
> - Adding pathname_address_sockets to cover all types of address
> formats for unix sockets, and moving remove_path() to
> common.h to reuse in this test.
> ---
> .../landlock/scoped_abstract_unix_test.c | 204 ++++++++++++++++++
> 1 file changed, 204 insertions(+)
>
> diff --git a/tools/testing/selftests/landlock/scoped_abstract_unix_test.c b/tools/testing/selftests/landlock/scoped_abstract_unix_test.c
> index 232c3b767b8a..21285a7158b6 100644
> --- a/tools/testing/selftests/landlock/scoped_abstract_unix_test.c
> +++ b/tools/testing/selftests/landlock/scoped_abstract_unix_test.c
> @@ -939,4 +939,208 @@ TEST_F(unix_sock_special_cases, socket_with_different_domain)
> WEXITSTATUS(status) != EXIT_SUCCESS)
> _metadata->exit_code = KSFT_FAIL;
> }
> +
> +static const char path1[] = TMP_DIR "/s1_variant1";
> +static const char path2[] = TMP_DIR "/s2_variant1";
> +
> +/* clang-format off */
> +FIXTURE(pathname_address_sockets) {
> + struct service_fixture stream_address, dgram_address;
> +};
> +
> +/* clang-format on */
Please minimize the use of these tags (e.g. don't include new lines) and
remove them when they don't change the formatting.
> + if (WIFSIGNALED(status) || !WIFEXITED(status) ||
> + WEXITSTATUS(status) != EXIT_SUCCESS)
> + _metadata->exit_code = KSFT_FAIL;
> +}
Please always add a newline before TEST_HARNESS_MAIN.
`check-linux.sh all` prints an error.
> TEST_HARNESS_MAIN
> --
> 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 [this message]
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
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.Ohph6ahphohH@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).