]> git.baikalelectronics.ru Git - kernel.git/commit
fork, memcg: fix cached_stacks case
authorShakeel Butt <shakeelb@google.com>
Tue, 8 Jan 2019 23:22:57 +0000 (15:22 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 9 Jan 2019 01:15:11 +0000 (17:15 -0800)
commit22e23ea85175c70ca1bbbbb6a351a37a489d5075
tree873ae4401ee0cbaed0c0d2c77d457ec21fa0bfd7
parentae60817bdf60ee42520dd8b72fe6640819b06e1a
fork, memcg: fix cached_stacks case

Commit 07572a593c0d ("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: 07572a593c0d ("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>
kernel/fork.c