[Devel] [PATCH hci-8.1 v2 2/3] ve: free ve_name together with the ve, not at cgroup offline
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Mon Nov 16 16:49:18 MSK 2026
> From: Denis V. Lunev <den at openvz.org>
>
> ve_offline() frees ve->ve_name as soon as the ve cgroup goes offline,
> while the ve itself lives on as long as anything holds a reference, a
> ve namespace for one. Tasks of that namespace still point at the ve,
> and readers of another task's ve name, such as sched_show_task(),
> dereference the string with nothing that keeps it from being freed
> under them. A reference to the ve does not help either, as it does not
> hold the cgroup online.
>
> Free the name in ve_destroy() instead. That is css_free, which runs
> after an RCU grace period, so the name is valid for as long as the ve
> is and an RCU reader of task_ve() can print it. ve0 is never destroyed
> and keeps its static name. ve_offline() is left empty and goes away.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-155341
>
> Feature: ve: ve generic structures
> Suggested-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
> Signed-off-by: Denis V. Lunev <den at openvz.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261116134445.438480-1-den@openvz.org?part=2
More information about the Devel
mailing list