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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C1A1C4345F for ; Thu, 18 Apr 2024 14:25:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA4606B0092; Thu, 18 Apr 2024 10:25:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D54FF6B0096; Thu, 18 Apr 2024 10:25:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C1C516B0099; Thu, 18 Apr 2024 10:25:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A42366B0092 for ; Thu, 18 Apr 2024 10:25:34 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 58725161116 for ; Thu, 18 Apr 2024 14:25:34 +0000 (UTC) X-FDA: 82022875788.24.5EB1D18 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) by imf18.hostedemail.com (Postfix) with ESMTP id 794DA1C0014 for ; Thu, 18 Apr 2024 14:25:31 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=leemhuis.info header.s=he214686 header.b="T7/59qpj"; spf=pass (imf18.hostedemail.com: domain of regressions@leemhuis.info designates 80.237.130.52 as permitted sender) smtp.mailfrom=regressions@leemhuis.info; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713450331; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Zj6q68EGA4RlIzYy/XSYT8WM4sscbczTrgcDryITQrk=; b=I90OJwtZaaLFF76BauHzWx1VvPoCn9ssNZ6Hm4zqOLayOlGc9KLCF1syPsOl2SKEZkwXCK ROmouqpA4tpWTt69pkQYkv7d3+zDDnV4/7a9FfRK78fn8zs0kqO+kJqD75gXBESK5GIE9+ +1OeK4du8TjSPhlVb6nfGnWMEnpVaks= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713450331; a=rsa-sha256; cv=none; b=RALadRiFWTqj9K33gcimk2rj4Em/YjGjINJ3WFg2n6GE3sP5ue52SKakurr7LzdMnuTGHp th2jAsMqDdUoFNDQeU5WURmU8++0i4+dmPqz4gjLDMvhyK+2Z6x2EFlURuMq2wEPi2SKwP Zq3WeYPMEWtTlLvdwwcTtA3Q+qb401w= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=leemhuis.info header.s=he214686 header.b="T7/59qpj"; spf=pass (imf18.hostedemail.com: domain of regressions@leemhuis.info designates 80.237.130.52 as permitted sender) smtp.mailfrom=regressions@leemhuis.info; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=leemhuis.info; s=he214686; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: In-Reply-To:References; bh=Zj6q68EGA4RlIzYy/XSYT8WM4sscbczTrgcDryITQrk=; t=1713450331; x=1713882331; b=T7/59qpjbf9wwYSMNQG7dDRQ0JNnNSuGcQaaSCfCdGzfWA+ F8EtO12IpmACShQPYEg7WRx1Vem6ehnTE1jdAUvG3fcZ0kgyiFCfuaTMSahFLvVThpmxh07FJyObC 6dfDQdRBFNL7owBORPtJdrYr3ezKY6WM+W8U+SRx982WspP1Yd9sK4XPnImk2/0beErOUqTH/jlk6 cQH60Srtq+RXnsmldd+N9Hf0rwHmavr59eSDfeRDV/SXV+v93upLlQ0K/qwO5vs+I5u1byd4aMZ1p EjygYT39WjHkq+plDspQdlrxaEgr+4lsT3zZ4RW4YK+ZUZS0gOwmUIJjkKxPKeaA==; Received: from [2a02:8108:8980:2478:8cde:aa2c:f324:937e]; authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1rxShb-0005cg-PE; Thu, 18 Apr 2024 16:25:27 +0200 Message-ID: <93766ae3-30d9-4dd3-ba01-870cc6387df4@leemhuis.info> Date: Thu, 18 Apr 2024 16:25:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [REGRESSION] Null pointer dereference while shrinking zswap To: Johannes Weiner , Christian Heusel Cc: Chengming Zhou , Nhat Pham , Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Runge , "Richard W.M. Jones" , Mark W , regressions@lists.linux.dev, Yosry Ahmed References: <3iccc6vjl5gminut3lvpl4va2lbnsgku5ei2d7ylftoofy3n2v@gcfdvtsq6dx2> <246c1f4d-af13-40fa-b968-fbaf36b8f91f@linux.dev> <20240417143324.GA1055428@cmpxchg.org> <4c3ppfjxnrqx6g52qvvhqzcc4pated2q5g4mi32l22nwtrkqfq@a4lk6s5zcwvb> <20240418124043.GC1055428@cmpxchg.org> From: "Linux regression tracking (Thorsten Leemhuis)" Content-Language: en-US, de-DE Reply-To: Linux regressions mailing list In-Reply-To: <20240418124043.GC1055428@cmpxchg.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;regressions@leemhuis.info;1713450331;27bbf0d7; X-HE-SMSGID: 1rxShb-0005cg-PE X-Stat-Signature: 67ng6n84wqkqidxshk9pdhg96ihsyfx5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F4WRZA== 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: List-Subscribe: List-Unsubscribe: On 18.04.24 14:40, Johannes Weiner wrote: > On Wed, Apr 17, 2024 at 07:18:14PM +0200, Christian Heusel wrote: >> On 24/04/17 10:33AM, Johannes Weiner wrote: > Christian reports a NULL deref in zswap that he bisected down to the > zswap shrinker. The issue also cropped up in the bug trackers of > libguestfs [1] and the Red Hat bugzilla [2]. > > The problem is that when memcg is disabled with the boot time flag, > the zswap shrinker might get called with sc->memcg == NULL. This is > okay in many places, like the lruvec operations. But it crashes in > memcg_page_state() - which is only used due to the non-node accounting > of cgroup's the zswap memory to begin with. > > Nhat spotted that the memcg can be NULL in the memcg-disabled case, > and I was then able to reproduce the crash locally as well. Thx for the fix. Nitpicking: > [1] https://github.com/libguestfs/libguestfs/issues/139 > [2] https://bugzilla.redhat.com/show_bug.cgi?id=2275252 FWIW, those should ideally look like this: Link: https://github.com/libguestfs/libguestfs/issues/139 [1] Link: https://bugzilla.redhat.com/show_bug.cgi?id=2275252 [2] > Fixes: b5ba474f3f51 ("zswap: shrink zswap pool based on memory pressure") > Cc: stable@vger.kernel.org [v6.8] > Link: https://lkml.kernel.org/r/20240417143324.GA1055428@cmpxchg.org > Reported-by: Christian Heusel And here checkpatch.pl should have complained that the above line should ideally be followed by a Link or Closes tag to the report, e.g.: Closes: https://lore.kernel.org/all/3iccc6vjl5gminut3lvpl4va2lbnsgku5ei2d7ylftoofy3n2v@gcfdvtsq6dx2/ Which in this case would be nice, as I'm tracking this regression, hence regzbot will then track the patch and consider the regression resolved once the fix lands in mainline. Ciao, Thorsten