From: Mirian Shilakadze <mirian.shilakadze@virtuozzo.com>
To: khorenko@virtuozzo.com, ptikhomirov@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH vz10 0/6] ve: give the pseudosuper privileges only to the tasks setting up a VE
Date: Mon, 16 Nov 2026 14:45:43 +0400 [thread overview]
Message-ID: <20261116104552.102938-1-mirian.shilakadze@virtuozzo.com> (raw)
While a container starts or is restored, ve.pseudosuper is on and its
relaxations apply to every process in the container. The container's
own binaries that vzctl and CRIU run in that window get them too, such
as quotaon at start and the tee that vz-rst-action runs at post-restore.
Such a binary can rewrite the container's root memory.max, skip the
mount limit and the mount option filter, use NETLINK_REPAIR, or clear
pseudosuper early. During a restore it can also open /proc/<pid>/fd of
CRIU's restoring tasks and take CRIU's log, its /proc fd and the
transport socket.
This series marks the tasks the host sends into a starting VE as setup
tasks. Fork keeps the mark, exec drops it, and only a task coming from
the host gets it.
- 1/6 passes ve_setup_task() the VE a task comes from
- 2/6 hides only the tasks the host sends into a VE, in any state but
starting
- 3/6 marks setup tasks and lets them be reached only by each other
while the VE is pseudosuper
- 4/6 to 6/6 give the pseudosuper relaxations only to setup tasks: the
container's root cgroup files, the mount filter and limit, and the
rest. A host task that joins the VE after it has started, such as the
CRIU helper that mounts proc for a nested pid namespace, still skips
the mount limit.
Once pseudosuper is cleared, the restored processes are ordinary
container processes again. vzctl and CRIU need no change, the vzctl
start path was already fixed under VSTOR-151174.
Tested on kernel 6.12.0-211.75.1.24.1.vz10 on VHI 8.1 nodes, vzctl
10.0.148 and 10.0.159, criu 4.2.1.15 and 4.2.1.18, stock against
patched:
- a probe in place of the container's quotaon and tee: on stock it
reads the fds of every restoring task, restore.log included, sets
NETLINK_REPAIR and rewrites the root memory.max, on patched all of
it is refused
- the same probe gains nothing by moving into a nested VE and
unsharing it from a vfork child that shares its mm. With an earlier
version, which marked any task coming from another VE, it gained all
of the above.
- a container with a nested pid namespace restored with its mount
limit lowered to 10: restores. Without the exemption in 5/6 the
proc mount for that namespace failed with ENOMEM.
- a host task that joins a running container without exec stays
hidden from it
- after resume the container sees its restored processes and they
dump core, and start, stop, suspend, resume, a second disk and a
container at its mount limit behave as on stock
- CRIU zdtm in the ve flavor, with every userns test forced into it:
440 passed, the same 5 fail on stock with the same errors
- vzctl pytest 10.0.159: 1377 passed, 0 failed
Mirian Shilakadze (6):
ve: tell ve_setup_task() which VE the task comes from
ve: hide only the tasks the host sends into a VE
ve: hide the tasks that set up a starting VE from the rest of it
cgroup: give the CT root file writes and hidden roots only to setup
tasks
fs: give the mount relaxations of a pseudosuper VE only to setup tasks
ve: give the remaining pseudosuper relaxations only to setup tasks
fs/coredump.c | 2 +-
fs/namespace.c | 18 ++++++++----
include/linux/mm_types.h | 4 +++
include/linux/ve.h | 10 +++++--
kernel/cgroup/cgroup.c | 4 +--
kernel/ptrace.c | 23 +++++++++++++---
kernel/sys.c | 2 +-
kernel/ve/ve.c | 59 ++++++++++++++++++++++++++++++++++------
kernel/ve/ve_namespace.c | 7 +++--
net/netlink/af_netlink.c | 2 +-
security/device_cgroup.c | 2 +-
11 files changed, 106 insertions(+), 27 deletions(-)
--
2.43.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next reply other threads:[~2026-11-16 10:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 10:45 Mirian Shilakadze [this message]
2026-11-16 10:45 ` [Devel] [PATCH vz10 1/6] ve: tell ve_setup_task() which VE the task comes from Mirian Shilakadze
2026-11-16 10:50 ` no-reply
2026-11-16 10:45 ` [Devel] [PATCH vz10 2/6] ve: hide only the tasks the host sends into a VE Mirian Shilakadze
2026-11-16 10:50 ` no-reply
2026-11-16 17:17 ` Konstantin Khorenko
2026-11-16 10:45 ` [Devel] [PATCH vz10 3/6] ve: hide the tasks that set up a starting VE from the rest of it Mirian Shilakadze
2026-11-16 10:55 ` no-reply
2026-11-16 17:17 ` Konstantin Khorenko
2026-11-16 10:45 ` [Devel] [PATCH vz10 4/6] cgroup: give the CT root file writes and hidden roots only to setup tasks Mirian Shilakadze
2026-11-16 10:53 ` no-reply
2026-11-16 17:17 ` Konstantin Khorenko
2026-11-16 10:45 ` [Devel] [PATCH vz10 5/6] fs: give the mount relaxations of a pseudosuper VE " Mirian Shilakadze
2026-11-16 10:56 ` no-reply
2026-11-16 17:17 ` Konstantin Khorenko
2026-11-16 10:45 ` [Devel] [PATCH vz10 6/6] ve: give the remaining pseudosuper relaxations " Mirian Shilakadze
2026-11-16 10:56 ` no-reply
2026-11-16 17:17 ` Konstantin Khorenko
2026-11-16 17:17 ` [Devel] [PATCH vz10 0/6] ve: give the pseudosuper privileges only to the tasks setting up a VE Konstantin Khorenko
2026-11-17 10:21 ` Mirian Shilakadze
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=20261116104552.102938-1-mirian.shilakadze@virtuozzo.com \
--to=mirian.shilakadze@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@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.