Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp94737imu; Wed, 2 Jan 2019 14:59:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN43m/fOmVhys0pi9s3bbwqjDvM2w2xmGodxt75UOMAccBKHJQOfre/NRnbGaQeSPnikfwjN X-Received: by 2002:a17:902:930b:: with SMTP id bc11mr45944693plb.17.1546469950979; Wed, 02 Jan 2019 14:59:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546469950; cv=none; d=google.com; s=arc-20160816; b=WWLSY7u2Z2KUlYnOqlAmJgLsTZSNTBkfShLzMQAYeBOFqY5q7tGL7r+kyYzm9GeRQ5 aTtme65Vfneh3vvB12T9p7FtAJbIE3QbkS00/O07TA8aPD/QmacdvvOrWVoGcBGSiqlI IJ+S0j42oHlaooia8Tl8Kg8nA0zdi0lvtgWF7a5vSeALpqb60BNhdWgC2TLSZ/qqrBGx 9ki5WF0VS0OCMacuLPQ7Qp32sZpzoP7BtE6wYOfZunY9cA0P9XI/yCxBHG1VYjRyBU9S 8weaufWq1CMpI11ZRdSP9C33HtKrPFUhN7cO0eDP6OHuAchZSciuL6KT83WkPLgM5Dac X1WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FRRB2/LmPYA8ZvQO4Mcpor0wHhHtPna4bbzmKDsETGk=; b=MIpekmx9n3IHmVauey91unLdgasx43b24FUqF1FWn1wzaDXjlJa2gBMkxuV7UFFdKq XO0C1SjLl1ELq6zCFXiKqlrNVP/XwtbvRh3I8hm26lpvG1Gvssc0kCv4zT8jXYA6elhM n+MWUJl/gIXqZaAN/RnQUL03yI64eyp5DYxgGsr6DqREdPIlDy6yYtqCf9FXMlk3fn14 JNx5llm9j6DCVh2t4gOPB2IdTz9dtia/FpesSXurzIdXOK7tnkSYaKih1wjLKSZWlKK6 A8LTnpZ0nFsG425eo5ZLxLrH4K2h3gdrDAJQpG/DD/h7GTmX2hFa31bOBqpcEVsywe+X 03LQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o21si48006833pgj.415.2019.01.02.14.58.55; Wed, 02 Jan 2019 14:59:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726783AbfABUX6 (ORCPT + 99 others); Wed, 2 Jan 2019 15:23:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:40944 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726052AbfABUX5 (ORCPT ); Wed, 2 Jan 2019 15:23:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8F016AE25; Wed, 2 Jan 2019 20:23:55 +0000 (UTC) Date: Wed, 2 Jan 2019 21:23:48 +0100 From: Michal Hocko To: Shakeel Butt Cc: Rik van Riel , Roman Gushchin , Andrew Morton , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Weiner , Tejun Heo , stable@vger.kernel.org Subject: Re: [PATCH] fork, memcg: fix cached_stacks case Message-ID: <20190102202348.GE24572@dhcp22.suse.cz> References: <20190102180145.57406-1-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190102180145.57406-1-shakeelb@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Rik van Riel > Cc: Roman Gushchin > Cc: Michal Hocko > Cc: Johannes Weiner > Cc: Tejun Heo > Cc: Ups, I have overlook that. Thanks for catching that. Acked-by: Michal Hocko > --- > 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