diff options
| author | Yang Yingliang <yangyingliang@huawei.com> | 2020-08-13 20:27:57 +0000 |
|---|---|---|
| committer | Michael Bestas <mkbestas@lineageos.org> | 2022-04-19 00:51:39 +0300 |
| commit | 64599b136283d269e41060c6664bfd7d3bdddb78 (patch) | |
| tree | c89d1ca96f1035f895d5defa7bf34be319c136c7 | |
| parent | 8466ed4fdaac2166ef14728a1d8b731802398d61 (diff) | |
cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone()
Add skcd->no_refcnt check which is missed when backporting
ad0f75e5f57c ("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>
Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
| -rw-r--r-- | kernel/cgroup.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index c08e3ec0b449..a82951179ae4 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -6315,6 +6315,8 @@ void cgroup_sk_clone(struct sock_cgroup_data *skcd) { /* Socket clone path */ if (skcd->val) { + if (skcd->no_refcnt) + return; /* * We might be cloning a socket which is left in an empty * cgroup and the cgroup might have already been rmdir'd. |
