[Devel] [PATCH RHEL10 COMMIT] selftests/ve_ns_owner: make sure clone_child_func() does not fallthrough in parent code
Konstantin Khorenko
khorenko at virtuozzo.com
Mon May 18 19:28:11 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 a8d3013761fec08aa3ea1b8c4b0d63ce40431d34
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date: Fri May 15 13:53:34 2026 +0200
selftests/ve_ns_owner: make sure clone_child_func() does not fallthrough in parent code
This is safer: _exit is guaranteed at the call site regardless of what
the function does internally. Also it makes clone_child_func() and
unshare_child_func() follow the same scheme.
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 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/ve/ve_ns_owner_test.c b/tools/testing/selftests/ve/ve_ns_owner_test.c
index d9cb66bb0df64..b5b4f10be72b9 100644
--- a/tools/testing/selftests/ve/ve_ns_owner_test.c
+++ b/tools/testing/selftests/ve/ve_ns_owner_test.c
@@ -177,11 +177,11 @@ static int clone_child_func(void *arg)
close(ctx->sync.parent_to_child[1]);
if (write(ctx->sync.child_to_parent[1], "R", 1) != 1)
- _exit(11);
+ return 11;
if (read(ctx->sync.parent_to_child[0], &ack, 1) != 1)
- _exit(12);
+ return 12;
- _exit(0);
+ return 0;
}
/*
@@ -317,7 +317,7 @@ TEST_F(ve_ns_owner, clone_newve_newnet_newns)
pid = syscall(__NR_clone3, &cargs, sizeof(cargs));
ASSERT_GE(pid, 0);
if (pid == 0)
- clone_child_func(&ctx);
+ _exit(clone_child_func(&ctx));
close(ctx.sync.child_to_parent[1]);
close(ctx.sync.parent_to_child[0]);
More information about the Devel
mailing list