]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Fri, 14 Aug 2020 16:51:37 +0000 (12:51 -0400)
committerSasha Levin <sashal@kernel.org>
Fri, 14 Aug 2020 16:51:37 +0000 (12:51 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/cgroup-add-missing-skcd-no_refcnt-check-in-cgroup_sk.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/cgroup-add-missing-skcd-no_refcnt-check-in-cgroup_sk.patch b/queue-4.14/cgroup-add-missing-skcd-no_refcnt-check-in-cgroup_sk.patch
new file mode 100644 (file)
index 0000000..70cfa20
--- /dev/null
@@ -0,0 +1,34 @@
+From 9806f80403337066a2c9c48d1c595f5ad8e7be76 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 13 Aug 2020 20:29:16 +0000
+Subject: cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+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>
+---
+ kernel/cgroup/cgroup.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
+index a2fed8fbd2bde..ada060e628ce3 100644
+--- a/kernel/cgroup/cgroup.c
++++ b/kernel/cgroup/cgroup.c
+@@ -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.
+-- 
+2.25.1
+
index 47710b4642d1911ee780cd52c490846f6350566a..1ebd031735e6babed6f02fb545a8929165aeff88 100644 (file)
@@ -42,3 +42,4 @@ rxrpc-fix-race-between-recvmsg-and-sendmsg-on-immediate-call-failure.patch
 smack-fix-use-after-free-in-smk_write_relabel_self.patch
 tracepoint-mark-__tracepoint_string-s-__used.patch
 hid-input-fix-devices-that-return-multiple-bytes-in-battery-report.patch
+cgroup-add-missing-skcd-no_refcnt-check-in-cgroup_sk.patch