[Devel] [PATCH RHEL10 COMMIT] selftests/ve_ns_owner: fix double close and fallthrough
Konstantin Khorenko
khorenko at virtuozzo.com
Mon May 18 19:28:10 MSK 2026
The commit is pushed to "branch-rh10-6.12.0-55.52.1.5.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.52.1.5.26.vz10
------>
commit 70cfa37395ab24f16631d040401aa80bd456456f
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date: Fri May 15 13:53:33 2026 +0200
selftests/ve_ns_owner: fix double close and fallthrough
In both tests the parent closes two pipe ends manually, then calls
sync_pipes_close() which closes all four.
This results in a double-close on two fds.
Let's remove sync_pipes_close() and manually close the two still open fds.
https://virtuozzo.atlassian.net/browse/VSTOR-129744
Fixes: 4fe045fa7c00a ("selftests/ve: regression test for CLONE_NEWVE owner correctness")
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Feature: ve: ve generic structures
---
tools/testing/selftests/ve/ve_ns_owner_test.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/ve/ve_ns_owner_test.c b/tools/testing/selftests/ve/ve_ns_owner_test.c
index 1f82955eb4c34..d9cb66bb0df64 100644
--- a/tools/testing/selftests/ve/ve_ns_owner_test.c
+++ b/tools/testing/selftests/ve/ve_ns_owner_test.c
@@ -153,14 +153,6 @@ static int sync_pipes_init(struct sync_pipes *s)
return 0;
}
-static void sync_pipes_close(struct sync_pipes *s)
-{
- close(s->child_to_parent[0]);
- close(s->child_to_parent[1]);
- close(s->parent_to_child[0]);
- close(s->parent_to_child[1]);
-}
-
/*
* Per-test context shared between parent and child.
*/
@@ -344,7 +336,8 @@ TEST_F(ve_ns_owner, clone_newve_newnet_newns)
ASSERT_TRUE(WIFEXITED(status));
ASSERT_EQ(WEXITSTATUS(status), 0);
- sync_pipes_close(&ctx.sync);
+ close(ctx.sync.child_to_parent[0]);
+ close(ctx.sync.parent_to_child[1]);
}
/*
@@ -419,7 +412,8 @@ TEST_F(ve_ns_owner, unshare_newve_newnet_newns)
ASSERT_TRUE(WIFEXITED(status));
ASSERT_EQ(WEXITSTATUS(status), 0);
- sync_pipes_close(&ctx.sync);
+ close(ctx.sync.child_to_parent[0]);
+ close(ctx.sync.parent_to_child[1]);
}
TEST_HARNESS_MAIN
More information about the Devel
mailing list