[Devel] [PATCH hci-8.2 v3 3/6] ve: hide the tasks that set up a starting VE from the rest of it

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Wed Nov 18 13:47:10 MSK 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ve: VD_VE_SETUP_TASK mark is applied on STARTING state without
  checking is_pseudosuper
--

commit 1bee34c8ee24e68c2c82698a010c5bdd82a015b8
Author: Mirian Shilakadze <mirian.shilakadze at virtuozzo.com>

ve: hide the tasks that set up a starting VE from the rest of it

The patch marks tasks the host sends into a starting VE as VD_VE_SETUP_TASK. While the VE is pseudosuper, such tasks dump no core and are reachable only from other setup tasks of that VE. Once pseudosuper is cleared, the mark counts as VD_PTRACE_COREDUMP.

> diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
> --- a/kernel/ve/ve.c
> +++ b/kernel/ve/ve.c

[ ... ]

> @@ -1836,18 +1879,28 @@ EXPORT_SYMBOL(ve_get_cpu_stat);
>  void ve_setup_task(struct task_struct *task, struct ve_struct *old_ve,
>  		   struct ve_struct *ve)
>  {
[ ... ]
> +	if (mm && old_ve != ve) {
> +		if (ve_is_super(old_ve) ||
> +		    ve_vps_dumpable(mm, old_ve) == VD_VE_SETUP_TASK)
> +			mm->vps_dumpable = ve->state == VE_STATE_STARTING ?
> +					   VD_VE_SETUP_TASK : VD_VE_ENTER_TASK;
> +		else if (mm->vps_dumpable == VD_VE_SETUP_TASK)
> +			mm->vps_dumpable = VD_PTRACE_COREDUMP;
> +	}

[Severity: Low]
Can a task get the VD_VE_SETUP_TASK mark in a VE that is not pseudosuper? The mark is chosen from ve->state alone, and ve->is_pseudosuper is never checked here.

ve_pseudosuper_write() only refuses a 0->1 flip when VE_IS_RUNNING(ve) || ve->ve_nsproxy. ve_nsproxy is set only in ve_start_container(), so the host can still set pseudosuper=1 on a STARTING VE that already has tasks. ve_vps_dumpable() reports the mark as VD_PTRACE_COREDUMP only while is_pseudosuper is 0. After the flip, the already-marked tasks become setup tasks again. They are then unreachable from ordinary tasks of the VE and dump no core.

This also contradicts the ve_vps_dumpable() comment, which says pseudosuper "cannot be set again while @ve runs". Would it be better to require ve->is_pseudosuper when applying the mark? Alternatively, reject the 0->1 flip once the VE has tasks.

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261118103656.363171-1-mirian.shilakadze@virtuozzo.com?part=3



More information about the Devel mailing list