Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:27 +0100
committerJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:35 +0100
commitd0aa720babe3ec4151382ec4b7357677f0699f04 (patch)
tree50f19047259154c33bcb2addb08ed8fdef6a5afe
parent0765803afdba96c0f6fe7c6230e06ae741c893fc (diff)
fork, memcg: fix cached_stacks case (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.3-027-fork-memcg-fix-cached_stacks-case.patch48
-rw-r--r--series.conf1
2 files changed, 49 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-027-fork-memcg-fix-cached_stacks-case.patch b/patches.kernel.org/4.20.3-027-fork-memcg-fix-cached_stacks-case.patch
new file mode 100644
index 0000000000..7a30ac1502
--- /dev/null
+++ b/patches.kernel.org/4.20.3-027-fork-memcg-fix-cached_stacks-case.patch
@@ -0,0 +1,48 @@
+From: Shakeel Butt <shakeelb@google.com>
+Date: Tue, 8 Jan 2019 15:22:57 -0800
+Subject: [PATCH] fork, memcg: fix cached_stacks case
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: ba4a45746c362b665e245c50b870615f02f34781
+
+commit ba4a45746c362b665e245c50b870615f02f34781 upstream.
+
+Commit 5eed6f1dff87 ("fork,memcg: fix crash in free_thread_stack on
+memcg charge fail") fixes a crash caused due to failed memcg charge of
+the kernel stack. However the fix misses the cached_stacks case which
+this patch fixes. So, the same crash can happen if the memcg charge of
+a cached stack is failed.
+
+Link: http://lkml.kernel.org/r/20190102180145.57406-1-shakeelb@google.com
+Fixes: 5eed6f1dff87 ("fork,memcg: fix crash in free_thread_stack on memcg charge fail")
+Signed-off-by: Shakeel Butt <shakeelb@google.com>
+Acked-by: Michal Hocko <mhocko@suse.com>
+Acked-by: Rik van Riel <riel@surriel.com>
+Cc: Rik van Riel <riel@surriel.com>
+Cc: Roman Gushchin <guro@fb.com>
+Cc: Johannes Weiner <hannes@cmpxchg.org>
+Cc: Tejun Heo <tj@kernel.org>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ kernel/fork.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/kernel/fork.c b/kernel/fork.c
+index 3c16bc490583..906cd0c13d15 100644
+--- a/kernel/fork.c
++++ b/kernel/fork.c
+@@ -221,6 +221,7 @@ static unsigned long *alloc_thread_stack_node(struct task_struct *tsk, int node)
+ memset(s->addr, 0, THREAD_SIZE);
+
+ tsk->stack_vm_area = s;
++ tsk->stack = s->addr;
+ return s->addr;
+ }
+
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 4a1f4e63be..3d1356a60c 100644
--- a/series.conf
+++ b/series.conf
@@ -264,6 +264,7 @@
patches.kernel.org/4.20.3-024-USB-storage-don-t-insert-sane-sense-for-SPC3-w.patch
patches.kernel.org/4.20.3-025-USB-storage-add-quirk-for-SMI-SM3350.patch
patches.kernel.org/4.20.3-026-USB-Add-USB_QUIRK_DELAY_CTRL_MSG-quirk-for-Cor.patch
+ patches.kernel.org/4.20.3-027-fork-memcg-fix-cached_stacks-case.patch
########################################################
# Build fixes that apply to the vanilla kernel too.