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 v10 2/6] selftests/Landlock: general scoped restriction tests
Date: Tue, 20 Aug 2024 17:58:02 +0200 [thread overview]
Message-ID: <20240820.nah8bahngaiF@digikod.net> (raw)
In-Reply-To: <6c0558cefc8295687f8a3a900b0582f74730dbb2.1724125513.git.fahimitahera@gmail.com>
"Re: [PATCH v10 2/6] selftests/Landlock: general scoped restriction"
This subject is still incorrect, please use this instead:
"selftests/landlock: Add common scope tests"
The same rule for the subject prefix should be followed for all other
commits (see my previous review).
On Mon, Aug 19, 2024 at 10:08:52PM -0600, Tahera Fahimi wrote:
> The test function, "ruleset_with_unknown_scoped", is designed to
> validate the behaviour of the "landlock_create_ruleset" function
> when it is provided with an unsupported or unknown scoped mask.
>
> Signed-off-by: Tahera Fahimi <fahimitahera@gmail.com>
> ---
> .../testing/selftests/landlock/scoped_test.c | 33 +++++++++++++++++++
> 1 file changed, 33 insertions(+)
> create mode 100644 tools/testing/selftests/landlock/scoped_test.c
>
> diff --git a/tools/testing/selftests/landlock/scoped_test.c b/tools/testing/selftests/landlock/scoped_test.c
> new file mode 100644
> index 000000000000..aee853582451
> --- /dev/null
> +++ b/tools/testing/selftests/landlock/scoped_test.c
> @@ -0,0 +1,33 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Landlock tests - Scope Restriction
Landlock tests - Common scope restrictions
> + *
> + * Copyright © 2024 Tahera Fahimi <fahimitahera@gmail.com>
> + */
> +
> +#define _GNU_SOURCE
> +#include <errno.h>
> +#include <linux/landlock.h>
> +#include <sys/prctl.h>
> +
> +#include "common.h"
> +
> +#define ACCESS_LAST LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET
> +
> +TEST(ruleset_with_unknown_scoped)
"ruleset_with_unknown_scope" makes more sense (also in the commit
message).
> +{
> + __u64 scoped_mask;
> +
> + for (scoped_mask = 1ULL << 63; scoped_mask != ACCESS_LAST;
> + scoped_mask >>= 1) {
> + struct landlock_ruleset_attr ruleset_attr = {
> + .scoped = scoped_mask,
> + };
> +
> + ASSERT_EQ(-1, landlock_create_ruleset(&ruleset_attr,
> + sizeof(ruleset_attr), 0));
> + ASSERT_EQ(EINVAL, errno);
> + }
> +}
Good!
> +
> +TEST_HARNESS_MAIN
> --
> 2.34.1
>
>
next prev parent reply other threads:[~2024-08-20 15:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 4:08 [PATCH v10 0/6] Landlock: Add abstract UNIX socket connect restriction Tahera Fahimi
2024-08-20 4:08 ` [PATCH v10 1/6] " Tahera Fahimi
2024-08-20 19:14 ` Simon Horman
2024-08-20 4:08 ` [PATCH v10 2/6] selftests/Landlock: general scoped restriction tests Tahera Fahimi
2024-08-20 15:58 ` Mickaël Salaün [this message]
2024-08-20 4:08 ` [PATCH v10 3/6] selftests/Landlock: Abstract UNIX socket " Tahera Fahimi
2024-08-20 16:00 ` Mickaël Salaün
2024-08-20 4:08 ` [PATCH v10 4/6] selftests/Landlock: Add pathname UNIX socket tests Tahera Fahimi
2024-08-20 4:08 ` [PATCH v10 5/6] sample/Landlock: Support abstract unix socket restriction Tahera Fahimi
2024-08-21 15:59 ` Mickaël Salaün
2024-08-20 4:08 ` [PATCH v10 6/6] Landlock: Document LANDLOCK_SCOPED_ABSTRACT_UNIX_SOCKET and ABI versioning 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=20240820.nah8bahngaiF@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).