[Devel] [PATCH VZ8 3/3] cgroup: fix potential deadlock

Valeriy Vdovin valeriy.vdovin at virtuozzo.com
Wed Apr 21 18:55:06 MSK 2021


In cgroup_mark_ve_roots at error path one css_spin_lock is
not released. Fixed that.

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 500da91..4bd2401 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;
 	}
 
-- 
1.8.3.1



More information about the Devel mailing list