From: Michal Hocko <mhocko@kernel.org>
To: Shakeel Butt <shakeelb@google.com>
Cc: Rik van Riel <riel@surriel.com>, Roman Gushchin <guro@fb.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org,
Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH] fork, memcg: fix cached_stacks case
Date: Wed, 2 Jan 2019 21:23:48 +0100 [thread overview]
Message-ID: <20190102202348.GE24572@dhcp22.suse.cz> (raw)
In-Reply-To: <20190102180145.57406-1-shakeelb@google.com>
On Wed 02-01-19 10:01:45, Shakeel Butt wrote:
> 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.
>
> Fixes: 5eed6f1dff87 ("fork,memcg: fix crash in free_thread_stack on memcg charge fail")
> Signed-off-by: Shakeel Butt <shakeelb@google.com>
> Cc: Rik van Riel <riel@surriel.com>
> Cc: Roman Gushchin <guro@fb.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: <stable@vger.kernel.org>
Ups, I have overlook that. Thanks for catching that.
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> kernel/fork.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index e4a51124661a..593cd1577dff 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -216,6 +216,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.415.g653613c723-goog
>
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2019-01-02 20:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-02 18:01 Shakeel Butt
2019-01-02 18:01 ` Shakeel Butt
2019-01-02 20:23 ` Michal Hocko [this message]
2019-01-04 20:14 ` Rik van Riel
2019-01-04 20:14 ` Rik van Riel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190102202348.GE24572@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=riel@surriel.com \
--cc=shakeelb@google.com \
--cc=stable@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox