[rh7] cgroup: add missing dput() in cgroup_unmark_ve_roots()

Submitted by Andrey Ryabinin on Aug. 28, 2020, 12:01 p.m.

Details

Message ID 20200828120138.6869-1-aryabinin@virtuozzo.com
State New
Series "cgroup: add missing dput() in cgroup_unmark_ve_roots()"
Headers show

Commit Message

Andrey Ryabinin Aug. 28, 2020, 12:01 p.m.
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 <aryabinin@virtuozzo.com>
---
 kernel/cgroup.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

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);