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 30809C54E58 for ; Thu, 14 Mar 2024 03:01:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 655CF8007A; Wed, 13 Mar 2024 23:01:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6065C80073; Wed, 13 Mar 2024 23:01:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 524BA8007A; Wed, 13 Mar 2024 23:01:52 -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 4459B80073 for ; Wed, 13 Mar 2024 23:01:52 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E295EA1492 for ; Thu, 14 Mar 2024 03:01:51 +0000 (UTC) X-FDA: 81894144822.25.722E84F Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by imf01.hostedemail.com (Postfix) with ESMTP id 55C8E40005 for ; Thu, 14 Mar 2024 03:01:48 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of penguin-kernel@I-love.SAKURA.ne.jp designates 202.181.97.72 as permitted sender) smtp.mailfrom=penguin-kernel@I-love.SAKURA.ne.jp; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710385310; a=rsa-sha256; cv=none; b=puRx0FwPKeLbd/HEqy/oYmVFSpKkgVMBmJVkxaDEn3vAIZBmyxtEIBJzcbqxetLEim2K0g lofE/eqSNAJ8Xyu3sMlFRhfuoxMrKheK2hJb0jWkLxiTkMPDPx9fwU++PDOzHPrGtV7cmM L8EmWMfCoTX0KoE9jsIrH6ET1E3goGQ= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of penguin-kernel@I-love.SAKURA.ne.jp designates 202.181.97.72 as permitted sender) smtp.mailfrom=penguin-kernel@I-love.SAKURA.ne.jp; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710385310; h=from:from:sender: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; bh=PKQPZGd8S9cJ1ZJf8alUxzrEbC20jRp7iqZD7wVY8/0=; b=p9iOvaxFuAmHUcWeHd5SrdMVrznuoNnpoau5HEB1D+GH1EsgPSGPZWd4tvF8xB1ysRaxnk JDBWetDEOoXOb8j/81MNkcGWFXIjNAhjutdhDJzkPwLovRuYNzbBWuYY0SNu6divYIZ6AC 9+Fp2EfoUoL3fxqWy2JDkKwqAhaNf9U= Received: from fsav313.sakura.ne.jp (fsav313.sakura.ne.jp [153.120.85.144]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 42E31SKK004142; Thu, 14 Mar 2024 12:01:28 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav313.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav313.sakura.ne.jp); Thu, 14 Mar 2024 12:01:27 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav313.sakura.ne.jp) Received: from [192.168.1.6] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 42E31RBp004134 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Thu, 14 Mar 2024 12:01:27 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <2ff96a50-fc65-4e42-b15d-097c0f15a455@I-love.SAKURA.ne.jp> Date: Thu, 14 Mar 2024 12:01:24 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm,page_owner: Fix recursion Content-Language: en-US To: Oscar Salvador , Andrew Morton , Lei Yang Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Vlastimil Babka , Marco Elver , Andrey Konovalov , Alexander Potapenko References: <20240313234245.18824-1-osalvador@suse.de> From: Tetsuo Handa In-Reply-To: <20240313234245.18824-1-osalvador@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 55C8E40005 X-Stat-Signature: rwz41xf4rj14knd7gjxgn3ismdidthqg X-HE-Tag: 1710385308-788453 X-HE-Meta: U2FsdGVkX18AReIXvynl9oWJP/e6jGyREEqSQraBEblC9MdtckphijGTyRR2G7SBA7Gt1bZxuEncXJfpgQmL5GzvKZBLZ3Op8qjK82BIcRm0JbybKuLnvPhxC+3Xcjqsut8WSu9EXzfTOraAv5O8E5DPSrvpDNCE/9mU81pqNOtXFMUlCb3BeYxgjDWw8t5G0Ab9XwdD/00V4x+t/23psLUaJJE7AenNw1Hu3F+/wDLB3iJenU06A01eE6XoqwRmI5wVe1F7/thWCLJ2ylufcHVH1UDGFAue/0bB+maYGsxo4CCt1MN5zIp6yzjDCxqv55HzR0cdKc544OVFoEOm89/dntlNWNurGH0ZFpUVL4+c1lkekmAeRom4uYlnpWj7lbyKGxSYexcyk4DVaI374MKVusauzkIMpYCKzAF8jHekzOKxfhXrwELFb9OOtRRzrZU9S58VrvGbgyMRh1kqlHNg5nBpVU5SEquWjHcTJwuRWurpSKYGIEOeQG+jaDOGlcEhO7y4tsjw7NRaVTC+V+vHlZzNVE3W8yz+24pamFz1G63kBIZOowW1LldoxcqF4a9/rvCtZYGx/ik3Bc//v4R94lgeczij/44GtySHL9+SapaF8gEOojxjV1o6aB9iDsSROfBjBBEKZxWfyiZFLl3RXsPTVnkfgHLQA1MOQCFuYa9MJs7AXjneLPXy+AQPkWWDhnuPcEuQAJBNTwMct7tM41+Y6+JUFdElqk7Wbm6kEGl9UfIOfOi/xJnu7AZgjRUj7oJUTOumAf82Uk8/GEigl0q5T8cCkrhE+YPtqwuCRFcW+Vxh1oWNufBzPjupE53uWbXSwXBvfsXrG68Lr6cif+03Rd/16rCrAsqSPYgiqwOySMjVMJoPlQag5Ii3JZgycEwKUcr4FdZNTptdmzS9fMa293eIHGn7Y6xupIw= 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 2024/03/14 8:42, Oscar Salvador wrote: > Prior to 217b2119b9e2 ("mm,page_owner: implement the tracking of the stacks count") > the only place where page_owner could potentially go into recursion due to > its need of allocating more memory was in save_stack(), which ends up calling > into stackdepot code with the possibility of allocating memory. > > We made sure to guard against that by signaling that the current task was > already in page_owner code, so in case a recursion attempt was made, we > could catch that and return dummy_handle. > > After above commit, a new place in page_owner code was introduced where we > could allocate memory, meaning we could go into recursion would we take that > path. > > Make sure to signal that we are in page_owner in that codepath as well. > Move the guard code into two helpers {un}set_current_in_page_owner() > and use them prior to calling in the two functions that might allocate > memory. > > Signed-off-by: Oscar Salvador > Fixes: 217b2119b9e2 ("mm,page_owner: implement the tracking of the stacks count") Maybe culprit for a page owner refcount bug reported at https://syzkaller.appspot.com/bug?id=8e4e66dfe299a2a00204ad220c641daaf1486a00 , for that commit went to next-20240214 and syzbot started failing to test since next-20240215 ? Please send this patch to linux-next.git as soon as possible (or can someone experiencing this bug try booting linux-next.git with this patch applied, so that we can check whether syzbot can resume testing linux-next.git), and then send to linux.git together (so that various trees which depend on linux.git won't start failing to boot).