OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Mirian Shilakadze <mirian.shilakadze@virtuozzo.com>
To: Konstantin Khorenko <khorenko@virtuozzo.com>,
	Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 v2 1/2] ve: trust every host task of a pseudosuper VE until it execs
Date: Fri, 20 Nov 2026 17:43:46 +0400	[thread overview]
Message-ID: <ea5cc667-4a56-4f8d-8fcc-21e577e28dc6@virtuozzo.com> (raw)
In-Reply-To: <20261120-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v2-1-c85e827c1dba@virtuozzo.com>


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@virtuozzo.com>
Looks good to me.

Reviewed-by: Mirian Shilakadze <mirian.shilakadze@virtuozzo.com>

-- 
Best regards, Mirian Shilakadze
Linux C Virtualization Developer, Virtuozzo.

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-11-20 13:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 13:15 [Devel] [PATCH hci-8.2 v2 0/2] ve: Container start on the 26.3 kernel with libvzctl before 10.0.144 Konstantin Khorenko
2026-11-20 13:15 ` [Devel] [PATCH hci-8.2 v2 1/2] ve: trust every host task of a pseudosuper VE until it execs Konstantin Khorenko
2026-11-20 13:19   ` no-reply
2026-11-20 13:43   ` Mirian Shilakadze [this message]
2026-11-20 13:15 ` [Devel] [PATCH hci-8.2 v2 2/2] selftests/ve: check a host task entering a pseudosuper VE reaches its init Konstantin Khorenko
2026-11-20 13:21   ` no-reply
2026-11-20 13:47   ` 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=ea5cc667-4a56-4f8d-8fcc-21e577e28dc6@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox