[Devel] [PATCH RHEL7 COMMIT] ve/cgroup: change resource release order in ve_drop_context
Vasily Averin
vvs at virtuozzo.com
Thu Oct 29 17:01:04 MSK 2020
The commit is pushed to "branch-rh7-3.10.0-1127.18.2.vz7.163.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.18.2.vz7.163.41
------>
commit 6fd72185d1f282076b35b1de3d5435113897b835
Author: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
Date: Thu Oct 29 17:01:04 2020 +0300
ve/cgroup: change resource release order in ve_drop_context
This fixes 87cb5fdb5b5c77ac617b46a0fe118a7d50a77b1c
In the mentioned patch in cgroup_show_options ve->ve_ns is checked to
ensure that ve->root_css_set is usable. But in ve_drop_context
root_css_set is being released before ve_ns, which is a bug.
root_css_set will now be set to NULL after ve_ns is released.
This reordering only affects the described piece of code in
cgroup_show_options.
https://jira.sw.ru/browse/PSBM-121438
Signed-off-by: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
kernel/ve/ve.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index db26cbd4..f61b1fe 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -595,9 +595,6 @@ static void ve_drop_context(struct ve_struct *ve)
struct nsproxy *ve_ns = ve->ve_ns;
struct net *net = ve->ve_netns;
- put_css_set_taskexit(ve->root_css_set);
- ve->root_css_set = NULL;
-
ve->ve_netns = NULL;
put_net(net);
@@ -606,6 +603,9 @@ static void ve_drop_context(struct ve_struct *ve)
synchronize_rcu();
put_nsproxy(ve_ns);
+ put_css_set_taskexit(ve->root_css_set);
+ ve->root_css_set = NULL;
+
ve_hook_iterate_fini(VE_SHUTDOWN_CHAIN, ve);
put_cred(ve->init_cred);
More information about the Devel
mailing list