From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56220C63777 for ; Mon, 30 Nov 2020 20:24:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C8E96207F7 for ; Mon, 30 Nov 2020 20:24:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="uZKCv7OK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8E96207F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 13E166B0036; Mon, 30 Nov 2020 15:24:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0EF498D0002; Mon, 30 Nov 2020 15:24:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 003778D0001; Mon, 30 Nov 2020 15:24:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id DFB216B0036 for ; Mon, 30 Nov 2020 15:24:00 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id AA94E180AD820 for ; Mon, 30 Nov 2020 20:24:00 +0000 (UTC) X-FDA: 77542211040.17.move92_0706ac1273a4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 8CC9F180D0181 for ; Mon, 30 Nov 2020 20:24:00 +0000 (UTC) X-HE-Tag: move92_0706ac1273a4 X-Filterd-Recvd-Size: 4325 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Nov 2020 20:23:59 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 452A72073C; Mon, 30 Nov 2020 20:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1606767838; bh=HTJqRVsgfUeZtj17KLMMjxYqtajqMkjp6XIIbCE7RzQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uZKCv7OKfKjj9GaHvFseeYGnE+4o99b5bUcQNnGXPIyV1d6EH5yU83QKsZcxJVcIc /Xv+JeTtQiib1dDMBFhmAKp5hxB+jfqYfQULCCPJTPGRiN6ud7Gv2Z8HlWUuPCNpF5 Ub4CJ+kZKkgKooyz7fQT+D1CKLJDPQLCN0AsZ0eg= Date: Mon, 30 Nov 2020 12:23:57 -0800 From: Andrew Morton To: Vlastimil Babka Cc: Michal Hocko , Muchun Song , Johannes Weiner , Shakeel Butt , Roman Gushchin , Stephen Rothwell , alex.shi@linux.alibaba.com, alexander.h.duyck@linux.intel.com, Yafang Shao , richard.weiyang@gmail.com, LKML , Linux Memory Management List , Dmitry Osipenko Subject: Re: [External] Re: [PATCH] mm/memcg: fix NULL pointer dereference at workingset_eviction Message-Id: <20201130122357.cadd134cbad3130abfce618d@linux-foundation.org> In-Reply-To: References: <20201130131512.6043-1-songmuchun@bytedance.com> <20201130132345.GJ17338@dhcp22.suse.cz> <20201130134514.GL17338@dhcp22.suse.cz> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 30 Nov 2020 16:57:37 +0100 Vlastimil Babka wrote: > On 11/30/20 2:45 PM, Michal Hocko wrote: > > On Mon 30-11-20 21:36:49, Muchun Song wrote: > >> On Mon, Nov 30, 2020 at 9:23 PM Michal Hocko wrote: > >> > > >> > On Mon 30-11-20 21:15:12, Muchun Song wrote: > >> > > We found a case of kernel panic. The stack trace is as follows > >> > > (omit some irrelevant information): > >> > > > >> > > BUG: kernel NULL pointer dereference, address: 00000000000000c8 > >> > > RIP: 0010:workingset_eviction+0x26b/0x450 > >> > > Call Trace: > >> > > __remove_mapping+0x224/0x2b0 > >> > > shrink_page_list+0x8c2/0x14e0 > >> > > shrink_inactive_list+0x1bf/0x3f0 > >> > > ? do_raw_spin_unlock+0x49/0xc0 > >> > > ? _raw_spin_unlock+0xa/0x20 > >> > > shrink_lruvec+0x401/0x640 > >> > > > >> > > This was caused by commit 76761ffa9ea1 ("mm/memcg: bail out early when > >> > > !memcg in mem_cgroup_lruvec"). When the parameter of memcg is NULL, we > >> > > should not use the &pgdat->__lruvec. So this just reverts commit > >> > > 76761ffa9ea1 to fix it. > >> > > > >> > > Fixes: 76761ffa9ea1 ("mm/memcg: bail out early when !memcg in mem_cgroup_lruvec") > >> > > >> > I do not see any commits like that in the current Linus tree. Is this a > >> > commit id from the linux-next? If yes, can we just fold it into the > >> > respective patch in mmotm tree please? > >> > >> Yes. This commit is on the linux-next tree. > > > > FYI, patches coming from mmotm are constantly rebased in linux-next so > > the sha1 is meaningless and shouldn't be added as a reference in the > > changelog. > > > >> Of course can. > > > > Thanks! I believe Andrew should be able to just pick up the patch and > > make it -fix patch. > > Well the fix is a revert, so just remove the patch from mmotm/next? > BTW, looks like it wasn't sent to linux-mm [1], looks like missing To: header. > > [1] > https://lore.kernel.org/lkml/1606446515-36069-1-git-send-email-alex.shi@linux.alibaba.com/ Yes, I've dropped "mm/memcg: bail out early when !memcg in mem_cgroup_lruvec", thanks.