Skip to content

Commit 38de430

Browse files
Yang Yinglianggregkh
authored andcommitted
cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone()
Add skcd->no_refcnt check which is missed when backporting ad0f75e ("cgroup: fix cgroup_sk_alloc() for sk_clone_lock()"). This patch is needed in stable-4.9, stable-4.14 and stable-4.19. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 37274b5 commit 38de430

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

kernel/cgroup/cgroup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5957,6 +5957,8 @@ void cgroup_sk_clone(struct sock_cgroup_data *skcd)
59575957
{
59585958
/* Socket clone path */
59595959
if (skcd->val) {
5960+
if (skcd->no_refcnt)
5961+
return;
59605962
/*
59615963
* We might be cloning a socket which is left in an empty
59625964
* cgroup and the cgroup might have already been rmdir'd.

0 commit comments

Comments
 (0)