From d3cb8ef45576642aa6faa58470a9d1e8136ef8f6 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 14 Aug 2020 12:51:37 -0400 Subject: [PATCH] Fixes for 4.19 Signed-off-by: Sasha Levin --- ...ng-skcd-no_refcnt-check-in-cgroup_sk.patch | 34 +++++++++++++++++++ queue-4.19/series | 1 + 2 files changed, 35 insertions(+) create mode 100644 queue-4.19/cgroup-add-missing-skcd-no_refcnt-check-in-cgroup_sk.patch diff --git a/queue-4.19/cgroup-add-missing-skcd-no_refcnt-check-in-cgroup_sk.patch b/queue-4.19/cgroup-add-missing-skcd-no_refcnt-check-in-cgroup_sk.patch new file mode 100644 index 00000000000..67d656b3a3f --- /dev/null +++ b/queue-4.19/cgroup-add-missing-skcd-no_refcnt-check-in-cgroup_sk.patch @@ -0,0 +1,34 @@ +From 66445a82dda5d883a57096b7157d80e4cec417e2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 13 Aug 2020 20:33:42 +0000 +Subject: cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone() + +From: Yang Yingliang + +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 +Signed-off-by: Sasha Levin +--- + kernel/cgroup/cgroup.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c +index 6ae98c714edd6..2a879d34bbe58 100644 +--- a/kernel/cgroup/cgroup.c ++++ b/kernel/cgroup/cgroup.c +@@ -5957,6 +5957,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 + diff --git a/queue-4.19/series b/queue-4.19/series index 80ca8e053be..d4e705a2f7b 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -1,2 +1,3 @@ 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 -- 2.47.3