mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone()
Add skcd->no_refcnt check which is missed when backporting
ad0f75e5f5
("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>
This commit is contained in:
parent
2d5fdf1588
commit
1bfba2f427
1 changed files with 2 additions and 0 deletions
|
@ -5827,6 +5827,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.
|
||||
|
|
Loading…
Reference in a new issue