[Devel] [PATCH hci-8.2 v3 1/2] ve: trust every host task of a pseudosuper VE until it execs

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Mon Nov 23 11:56:21 MSK 2026



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.



More information about the Devel mailing list