[Devel] [PATCH RHEL8 COMMIT] cgroup: Add lost css_set_lock unlock in cgroup_mark_ve_roots()

Konstantin Khorenko khorenko at virtuozzo.com
Tue Apr 27 13:43:40 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.21
------>
commit 9f16192e9b1504e92f4f19330f3f235a3cf42c9b
Author: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
Date:   Wed Apr 21 18:55:06 2021 +0300

    cgroup: Add lost css_set_lock unlock in cgroup_mark_ve_roots()
    
    In cgroup_mark_ve_roots at error path one css_spin_lock is
    not released. Fixed that to avoid possible deadlock.
    
    Fixes: a0408143c426 ("ve/cgroup: Add release_agent to each container root
    cgroup")
    
    Signed-off-by: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
---
 kernel/cgroup/cgroup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 500da91baec7..4bd2401fb411 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -1996,6 +1996,7 @@ int cgroup_mark_ve_roots(struct ve_struct *ve)
 	cset = rcu_dereference(ve->ve_ns)->cgroup_ns->root_cset;
 	if (WARN_ON(!cset)) {
 		rcu_read_unlock();
+		spin_unlock_irq(&css_set_lock);
 		return -ENODEV;
 	}
 


More information about the Devel mailing list