[Devel] [PATCH hci-8.2 v2 1/2] ve: trust every host task of a pseudosuper VE until it execs
Mirian Shilakadze
mirian.shilakadze at virtuozzo.com
Fri Nov 20 16:43:46 MSK 2026
On 11/20/26 5:15 PM, Konstantin Khorenko wrote:
> Since "ve: hide the tasks that set up a starting VE from the rest of
> it" a host task entering a VE is marked VD_VE_SETUP_TASK only while the
> VE is VE_STATE_STARTING, and VD_VE_ENTER_TASK afterwards. While the VE
> is pseudosuper only the setup tasks may reach each other and use the
> pseudosuper relaxations; an entered task only skips the mount limit.
>
> libvzctl before 10.0.144 writes START to ve.state, which ends in
> VE_STATE_RUNNING, before it configures the disk: a helper then joins
> the init task's namespaces one by one through setns(), opens
> /proc/<init>/ns/mnt, makes the ploop device nodes and mounts the second
> disk inside the container. It joined a running VE, so it is an entered
> task, and the init task, a setup task, is hidden from it.
>
> Every container start with such a libvzctl fails:
>
> Failed to open /proc/<pid>/ns/mnt: Permission denied
> Failed to configure disk
> Cancel init execution
>
> libvzctl 10.0.144 and newer open the namespaces before joining any and
> are not affected.
>
> Both kinds of task come from the host and have not exec'd. Before the
> series every task of a pseudosuper VE had the relaxations, and libvzctl
> runs its in-process helpers for disks, devices, bind mounts and GPUs
> inside the VE after START, so trust them alike: ve_current_is_pseudosuper()
> accepts either mark while the VE is pseudosuper, and
> ve_current_is_host_task() goes. An entered task stays hidden from the
> container after pseudosuper is cleared, as before, and a binary the host
> tools exec still drops its mark.
>
> Fixes: a7d797d177e7 ("ve: hide the tasks that set up a starting VE from the rest of it")
> https://virtuozzo.atlassian.net/browse/VSTOR-156164
>
> Feature: trace: prohibit tracing sensitive tasks from CT
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
Looks good to me.
Reviewed-by: Mirian Shilakadze <mirian.shilakadze at virtuozzo.com>
--
Best regards, Mirian Shilakadze
Linux C Virtualization Developer, Virtuozzo.
More information about the Devel
mailing list