Re: [PATCH v12 09/12] selftests/landlock: Share enforce_ruleset()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





10/2/2023 11:26 PM, Mickaël Salaün пишет:
On Wed, Sep 20, 2023 at 05:26:37PM +0800, Konstantin Meskhidze wrote:
This commit moves enforce_ruleset() helper function to common.h so that
it can be used both by filesystem tests and network ones.

Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@xxxxxxxxxx>
---

Changes since v11:
* None.


diff --git a/tools/testing/selftests/landlock/fs_test.c b/tools/testing/selftests/landlock/fs_test.c
index 251594306d40..7c94d3933b68 100644
--- a/tools/testing/selftests/landlock/fs_test.c
+++ b/tools/testing/selftests/landlock/fs_test.c
@@ -677,17 +677,7 @@ static int create_ruleset(struct __test_metadata *const _metadata,
 	return ruleset_fd;
 }

-static void enforce_ruleset(struct __test_metadata *const _metadata,
-			    const int ruleset_fd)
-{
-	ASSERT_EQ(0, prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0));
-	ASSERT_EQ(0, landlock_restrict_self(ruleset_fd, 0))
-	{
-		TH_LOG("Failed to enforce ruleset: %s", strerror(errno));
-	}
-}
-
-TEST_F_FORK(layout0, proc_nsfs)
+TEST_F_FORK(layout1, proc_nsfs)

Why this change?

 Looks like a bug coming from v11 version.
 You have added layout0 recently. in V11 version
 there was TEST_F_FORK(layout1, proc_nsfs), and I missed the changed
 , resolving conflict with layout1.
 Will be fixed. Thanks.

 {
 	const struct rule rules[] = {
 		{
--
2.25.1

.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux