OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
To: Mirian Shilakadze <mirian.shilakadze@virtuozzo.com>,
	Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 v3 1/2] ve: trust every host task of a pseudosuper VE until it execs
Date: Mon, 23 Nov 2026 09:56:21 +0100	[thread overview]
Message-ID: <598c37e9-781a-4ab6-b387-75c40c43c40e@virtuozzo.com> (raw)
In-Reply-To: <c82f5d07-fc57-46b0-b716-a13b1f16e633@virtuozzo.com>



On 11/20/26 16:49, Mirian Shilakadze wrote:
> 
> On 11/20/26 7:04 PM, Pavel Tikhomirov wrote:
>> So if argument is VE0 we say yes we have privileges, no matter who we
>> are, even for VEX task.
> 
> That is older than this patch: ve0 has is_pseudosuper set, so the
> ve->is_pseudosuper checks always passed for ve0 whoever the caller was.
> The VSTOR-151265 series only kept that when it moved the checks to the
> caller's mark, with the ve_is_super(ve) shortcut.

Previously I believe all ve->is_pseudosuper calls implied get_exec_env(),
but now we move the check farther away from the place where we resolve ve,
so it is now much less obvious that ve can't be ve0 when current ve is veX,
should we maybe replace ve to explicit get_exec_env() here?

> 
>> If somehow get access to host root cgroup and it's ve is VE0 we have it
>> allowing us operation.
>>
>> If we somehow see host process from CT this also allows operation on it
>> (ptrace?).
> 
> I went through the callers, a container task gets nothing from it today:
> - most of them pass get_exec_env() and test ve_is_super() on it first,
>   so ve0 never gets there
> - ve.features, ve.failcount, ve.pid_max and ve.aio_max_nr are
>   CFTYPE_NOT_ON_ROOT, ve0 has no such files
> - ptrace never reaches the VD_VE_SETUP_TASK case for a ve0 target,
>   ve_vps_dumpable() reports it as VD_PTRACE_COREDUMP
> - the only place it is reachable is ve_try_reserve_mount() for a mount
>   in a ve0-owned mount namespace, and ve0 has no mount limit to skip
> 
> Still, it is easy to make it depend on the caller: when the argument is
> ve0, return ve_is_super(get_exec_env()). That changes nothing now but
> removes the trap for future callers. I can send it as a separate patch.

Why only when argument is ve0? why not always check ve_is_super(get_exec_env()) ?

> 

-- 
Best regards, Pavel Tikhomirov
Senior Software Developer, Virtuozzo.

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

  reply	other threads:[~2026-11-23  8:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 14:25 [Devel] [PATCH hci-8.2 v3 0/2] ve: Container start on the 26.3 kernel with libvzctl before 10.0.144 Konstantin Khorenko
2026-11-20 14:25 ` [Devel] [PATCH hci-8.2 v3 1/2] ve: trust every host task of a pseudosuper VE until it execs Konstantin Khorenko
2026-11-20 15:04   ` Pavel Tikhomirov
2026-11-20 15:49     ` Mirian Shilakadze
2026-11-23  8:56       ` Pavel Tikhomirov [this message]
2026-11-20 14:25 ` [Devel] [PATCH hci-8.2 v3 2/2] selftests/ve: check a host task entering a pseudosuper VE reaches its init Konstantin Khorenko
2026-11-20 14:39   ` Pavel Tikhomirov

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=598c37e9-781a-4ab6-b387-75c40c43c40e@virtuozzo.com \
    --to=ptikhomirov@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    --cc=mirian.shilakadze@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