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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 505F6C83017 for ; Mon, 30 Nov 2020 15:58:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A7B5205F4 for ; Mon, 30 Nov 2020 15:58:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728606AbgK3P6W (ORCPT ); Mon, 30 Nov 2020 10:58:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:36842 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728593AbgK3P6V (ORCPT ); Mon, 30 Nov 2020 10:58:21 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5145EAD6B; Mon, 30 Nov 2020 15:57:39 +0000 (UTC) Subject: Re: [External] Re: [PATCH] mm/memcg: fix NULL pointer dereference at workingset_eviction To: Michal Hocko , Muchun Song Cc: Andrew Morton , 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 References: <20201130131512.6043-1-songmuchun@bytedance.com> <20201130132345.GJ17338@dhcp22.suse.cz> <20201130134514.GL17338@dhcp22.suse.cz> From: Vlastimil Babka Message-ID: Date: Mon, 30 Nov 2020 16:57:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201130134514.GL17338@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/