From: no-reply@sashiko.virtuozzo.com
To: Konstantin Khorenko <khorenko@virtuozzo.com>,
Mirian Shilakadze <mirian.shilakadze@virtuozzo.com>,
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 v5 3/3] selftests/ve: check a host task entering a pseudosuper VE reaches its init
Date: Tue, 1 Dec 2026 01:02:32 +0000 [thread overview]
Message-ID: <010701a22f1ff143-13395110-1fe9-4718-bae0-f2fe4976ae13-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261127-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v5-3-32c4b6342ec2@virtuozzo.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] selftests/ve: run_init() may report START success after a failed
write
- [Low] selftests/ve: negative test accepts any EACCES, not just the
setup-task denial
--
commit d1314e3bf7a94b2e7ca6d3ca90983fd9dc1e00b8
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
selftests/ve: check a host task entering a pseudosuper VE reaches its init
This adds a selftest that starts a VE the way libvzctl does, with ve.pseudosuper set and an init cloned from the host. It then checks that a host task entering the VE reaches the init, and that a binary exec'd inside the VE does not.
> diff --git a/tools/testing/selftests/ve/ve_setup_task_test.c b/tools/testing/selftests/ve/ve_setup_task_test.c
> new file mode 100644
> index 0000000000000..66423f9f4a17f
> --- /dev/null
> +++ b/tools/testing/selftests/ve/ve_setup_task_test.c
[ ... ]
> +static void run_init(FIXTURE_DATA(ve_setup_task) * self, int status[2],
> + int release[2])
> +{
> + char c;
> +
> + prctl(PR_SET_PDEATHSIG, SIGKILL);
> + close(status[0]);
> + close(release[1]);
> + c = ve_write(self, "ve.state", "START") ? errno : 0;
[Severity: Low]
Can this report success after a failed START write? write_file_at() returns -1 on a short write without setting errno. In that case c gets a stale or zero errno, and the parent treats the start as successful. The later ve.state check still fails the test, but with a misleading EINVAL instead of the real error.
[ ... ]
> +TEST_F(ve_setup_task, exec_in_ve_does_not_reach_init)
> +{
[ ... ]
> + ASSERT_EQ(waitpid(p, &status, 0), p);
> + ASSERT_TRUE(WIFEXITED(status));
> + ASSERT_NE(WEXITSTATUS(status), 254);
> + EXPECT_EQ(WEXITSTATUS(status), EACCES)
> + TH_LOG("open of the init's mnt namespace: %s",
> + strerror(WEXITSTATUS(status)));
[Severity: Low]
Is this negative check specific enough? Any EACCES from the exec'd probe passes the test, whatever the cause. The proc ns get_link path returns -EACCES whenever ptrace_may_access() fails. That covers the uid/gid/capability checks, task_still_dumpable() and LSM hooks, so the errno does not identify the setup-task rule.
Would a control help, such as clearing ve.pseudosuper and checking that the same exec'd open then succeeds?
Carry the trailer below into the next revision and Sashiko will not review this patch again.
Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261127-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v5-0-32c4b6342ec2@virtuozzo.com?part=3
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-12-01 1:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 17:39 [Devel] [PATCH hci-8.2 v5 0/3] ve: Container start on the 26.3 kernel with libvzctl before 10.0.144 Konstantin Khorenko
2026-11-27 17:39 ` [Devel] [PATCH hci-8.2 v5 1/3] ve: trust every host task of a pseudosuper VE until it execs Konstantin Khorenko
2026-12-01 0:52 ` no-reply
2026-11-27 17:39 ` [Devel] [PATCH hci-8.2 v5 2/3] ve: give the pseudosuper relaxations of ve0 to its own tasks only Konstantin Khorenko
2026-12-01 0:55 ` no-reply
2026-11-27 17:39 ` [Devel] [PATCH hci-8.2 v5 3/3] selftests/ve: check a host task entering a pseudosuper VE reaches its init Konstantin Khorenko
2026-12-01 1:02 ` no-reply [this message]
2026-11-27 17:43 ` [Devel] [PATCH hci-8.2 v5 0/3] ve: Container start on the 26.3 kernel with libvzctl before 10.0.144 Konstantin Khorenko
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=010701a22f1ff143-13395110-1fe9-4718-bae0-f2fe4976ae13-000000@eu-central-1.amazonses.com \
--to=no-reply@sashiko.virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
--cc=mirian.shilakadze@virtuozzo.com \
--cc=ptikhomirov@virtuozzo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.