[Devel] [PATCH hci-8.2 v2 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
Tue Nov 17 13:27:39 MSK 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ve: stale raw VD_VE_SETUP_TASK mark survives a VE change and
acts as a setup mark
--
commit e0d51d916ebfeeef972b7b6efe4a3cba6fd46f27
Author: Mirian Shilakadze <mirian.shilakadze at virtuozzo.com>
ve: hide the tasks that set up a starting VE from the rest of it
The commit marks a task the host sends into a starting VE as VD_VE_SETUP_TASK. While the VE is pseudosuper, such a task dumps no core and is 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
[ ... ]
> +static bool ve_current_has_mark(struct ve_struct *ve, unsigned int mark)
> +{
> + struct mm_struct *mm = current->mm;
> +
> + return ve->is_pseudosuper && task_ve(current) == ve &&
> + mm && mm->vps_dumpable == mark;
> +}
[ ... ]
> + if (task->mm && old_ve != ve &&
> + (ve_is_super(old_ve) ||
> + ve_vps_dumpable(task->mm, old_ve) == VD_VE_SETUP_TASK))
> + task->mm->vps_dumpable = ve->state == VE_STATE_STARTING ?
> + VD_VE_SETUP_TASK : VD_VE_ENTER_TASK;
[Severity: Low]
Can a stale raw VD_VE_SETUP_TASK mark survive a VE change and be treated as a setup mark again?
ve_setup_task() tests the effective value from ve_vps_dumpable(). Once old_ve has left pseudosuper, that value is VD_PTRACE_COREDUMP, so the condition is false. The raw mm->vps_dumpable is then neither rewritten nor cleared.
Suppose a setup task of VE A stays there after A leaves pseudosuper, and is later moved into a different starting pseudosuper VE B. ve_current_has_mark() and ve_vps_dumpable() read the raw mm->vps_dumpable. The task therefore counts as a setup task of B, with the pseudosuper relaxations and ptrace reachability among B's setup tasks. The commit message says a task coming from a container never gets this.
Would clearing or normalizing the raw mark to VD_PTRACE_COREDUMP when the effective value is no longer VD_VE_SETUP_TASK fix this?
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261117101329.225854-1-mirian.shilakadze@virtuozzo.com?part=3
More information about the Devel
mailing list