From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Mirian Shilakadze <mirian.shilakadze@virtuozzo.com>,
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Cc: devel@openvz.org
Subject: [Devel] [PATCH RFC hci-8.2 0/2] ve: Container start on the 26.3 kernel with libvzctl before 10.0.144
Date: Thu, 19 Nov 2026 22:49:01 +0100 [thread overview]
Message-ID: <20261119-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v1-0-06fa0b8994a8@virtuozzo.com> (raw)
The VSTOR-151265 series (26.3) hides the setup tasks of a VE from every
other task of it while the VE is pseudosuper. ve_setup_task() marks a
host task a setup task only while the VE is VE_STATE_STARTING; a host
task entering afterwards is a VD_VE_ENTER_TASK and does not see them.
libvzctl before 10.0.144 starts a Container like this: pseudosuper=1,
clone the init, the init writes START (the VE is RUNNING from here on),
then a helper joins the init's namespaces one by one through setns()
and only then opens /proc/<init>/ns/mnt. The open comes from an ENTER
task of a pseudosuper VE, so it is refused:
Failed to open /proc/<pid>/ns/mnt: Permission denied
Failed to configure disk
Cancel init execution
Every Container start fails on the hci-8.1 userspace (libvzctl 10.0.134
and older). libvzctl 10.0.144 (vzctl commit 8bf40747, VSTOR-151174)
opens every namespace fd before it joins the first, while the helper is
still a ve0 task, and the start works; hci-8.2 ships 10.1.3 together
with the 26.3 kernel.
Verified on a test VM with the six Containers there:
+----------------------------+-------------------+-----------------+
| kernel | libvzctl 10.0.134 | libvzctl 10.1.3 |
+----------------------------+-------------------+-----------------+
| 26.3 as is | no CT starts | all start |
| 26.3 + patch 1 | all start | not run |
| RHEL 10.3 rebase as is | no CT starts | not run |
| RHEL 10.3 rebase + patch 1 | all start | not run |
+----------------------------+-------------------+-----------------+
So the 26.3 kernel depends on a libvzctl version and does not say so:
no commit of the series, its Jira or kernel.spec names libvzctl >=
10.0.144, and no vz kernel spec ever carried a Conflicts: on vzctl or
libvzctl. A node that gets the kernel, or a ReadyKernel patch with the
series, without the libvzctl update loses every Container start.
Two ways out, hence the RFC:
1. Apply patch 1. A host task that enters a VE while it is still
pseudosuper becomes a setup task whatever ve.state says, so the old
start sequence works again. The price: such a helper, if it stays in
the VE without exec, turns into an ordinary task once pseudosuper is
cleared (VD_VE_SETUP_TASK counts as VD_PTRACE_COREDUMP then), so the
container can reach its host fds, while as an ENTER task it stays
hidden for good. Mirian's view: the kernel is right, userspace must
be 10.0.144 or newer.
2. Drop patch 1 and declare the dependency instead: Conflicts:
libvzctl < 10.0.144 in kernel.spec, a release note, or both. Patch 2
is then wrong as it stands and can be turned round to check the
series' contract: a host task joining a running pseudosuper VE does
not reach the init, namespace fds opened before joining work, an
exec'd binary does not reach it.
Patch 2 is the selftest for the start sequence of libvzctl before
10.0.144: it starts a real VE (pseudosuper, clone3 into new pid, cgroup,
net and mnt namespaces, START) and checks that a host task joining
afterwards reaches the init's namespaces and an exec'd binary does not.
It fails on 26.3 as is and passes with patch 1.
https://virtuozzo.atlassian.net/browse/VSTOR-156164
To: Mirian Shilakadze <mirian.shilakadze@virtuozzo.com>
To: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Assisted-by: LLM
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
Konstantin Khorenko (2):
ve: mark a host task entering a pseudosuper VE as a setup task
selftests/ve: check a host task entering a pseudosuper VE reaches its init
kernel/ve/ve.c | 17 +-
tools/testing/selftests/ve/.gitignore | 1 +
tools/testing/selftests/ve/Makefile | 1 +
tools/testing/selftests/ve/ve_setup_task_test.c | 284 ++++++++++++++++++++++++
4 files changed, 295 insertions(+), 8 deletions(-)
---
base-commit: c1acd2c05aa3ebe0313958e2bd09f60f2040a5cb
change-id: 20261119-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-e11df3a8c1ba
Best regards,
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next reply other threads:[~2026-11-19 21:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 21:49 Konstantin Khorenko [this message]
2026-11-19 21:49 ` [Devel] [PATCH RFC hci-8.2 1/2] ve: mark a host task entering a pseudosuper VE as a setup task Konstantin Khorenko
2026-11-19 21:56 ` no-reply
2026-11-19 21:49 ` [Devel] [PATCH RFC hci-8.2 2/2] selftests/ve: check a host task entering a pseudosuper VE reaches its init Konstantin Khorenko
2026-11-19 21:54 ` no-reply
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=20261119-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v1-0-06fa0b8994a8@virtuozzo.com \
--to=khorenko@virtuozzo.com \
--cc=devel@openvz.org \
--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.