cset_cgroup_from_root() uses lockdep_assert_held(&css_set_lock), but
cgroup_join_vz_slice() and cgroup_leave_vz_slice() only stabilize the VE
nsproxy/cgroup_ns root_cset via rcu_dereference_protected().
For the default hierarchy the result is just cset->dfl_cgrp, which is
safe to read without css_set_lock (see current_cgns_cgroup_dfl()).
Call __cset_cgroup_from_root() instead so lockdep matches the actual
locking rules.

https://virtuozzo.atlassian.net/browse/VSTOR-128317

Signed-off-by: Vasileios Almpanis <[email protected]>

Feature: ve: ve generic structures
---
 kernel/cgroup/cgroup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 376c9bbd1c41..932414b882dd 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -2243,7 +2243,7 @@ int cgroup_join_vz_slice(struct ve_struct *ve)
        int ret;
 
        cset = rcu_dereference_protected(ve->ve_nsproxy, 
1)->cgroup_ns->root_cset;
-       cgrp = cset_cgroup_from_root(cset, &cgrp_dfl_root);
+       cgrp = __cset_cgroup_from_root(cset, &cgrp_dfl_root);
 
        if (!is_virtualized_cgroup(cgrp) ||
            !test_bit(CGRP_VE_ROOT, &cgrp->flags))
@@ -2278,7 +2278,7 @@ int cgroup_leave_vz_slice(struct ve_struct *ve)
        struct cgroup *cgrp;
 
        cset = rcu_dereference_protected(ve->ve_nsproxy, 
1)->cgroup_ns->root_cset;
-       cgrp = cset_cgroup_from_root(cset, &cgrp_dfl_root);
+       cgrp = __cset_cgroup_from_root(cset, &cgrp_dfl_root);
 
        if (!is_virtualized_cgroup(cgrp) ||
            !test_bit(CGRP_VE_ROOT, &cgrp->flags))
-- 
2.43.0

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to