cgroup_unmark_ve_roots() calls dget() on cgroup's dentry but don't
have the corresponding dput() call. This leads to leaking cgroups.

Add missing dput() to fix this.

https://jira.sw.ru/browse/PSBM-107328
Fixes: 1ac69e183447 ("ve/cgroup: added release_agent to each container root 
cgroup.")
Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com>
---
 kernel/cgroup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 55713a0071ce..5f3111805eba 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4719,6 +4719,7 @@ void cgroup_unmark_ve_roots(struct ve_struct *ve)
                mutex_lock(&inode->i_mutex);
                mutex_lock(&cgroup_mutex);
                cgroup_rm_file(cgrp, cft);
+               dput(cgrp->dentry);
                BUG_ON(!rcu_dereference_protected(cgrp->ve_owner,
                                lockdep_is_held(&cgroup_mutex)));
                rcu_assign_pointer(cgrp->ve_owner, NULL);
-- 
2.26.2

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to