]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.194/cgroup-add-missing-skcd-no_refcnt-check-in-cgroup_sk.patch
Drop nfc patches from older trees
[thirdparty/kernel/stable-queue.git] / releases / 4.14.194 / cgroup-add-missing-skcd-no_refcnt-check-in-cgroup_sk.patch
1 From 9806f80403337066a2c9c48d1c595f5ad8e7be76 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Thu, 13 Aug 2020 20:29:16 +0000
4 Subject: cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone()
5
6 From: Yang Yingliang <yangyingliang@huawei.com>
7
8 Add skcd->no_refcnt check which is missed when backporting
9 ad0f75e5f57c ("cgroup: fix cgroup_sk_alloc() for sk_clone_lock()").
10
11 This patch is needed in stable-4.9, stable-4.14 and stable-4.19.
12
13 Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
14 Signed-off-by: Sasha Levin <sashal@kernel.org>
15 ---
16 kernel/cgroup/cgroup.c | 2 ++
17 1 file changed, 2 insertions(+)
18
19 diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
20 index a2fed8fbd2bde..ada060e628ce3 100644
21 --- a/kernel/cgroup/cgroup.c
22 +++ b/kernel/cgroup/cgroup.c
23 @@ -5827,6 +5827,8 @@ void cgroup_sk_clone(struct sock_cgroup_data *skcd)
24 {
25 /* Socket clone path */
26 if (skcd->val) {
27 + if (skcd->no_refcnt)
28 + return;
29 /*
30 * We might be cloning a socket which is left in an empty
31 * cgroup and the cgroup might have already been rmdir'd.
32 --
33 2.25.1
34