Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp133284lqk; Wed, 13 Mar 2024 20:07:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7gKqRsBHmlAisbI3c4TPGQF2dR1CCvNhXJM+EGDX2Ek0vwbCLKmUojBFsMZYTQfBp1m72C6BTkUnePeK9BYVbHI54tWkipWY3ixsvoA== X-Google-Smtp-Source: AGHT+IEqWEZGpbNBAlvdhwoA8xt75UlThFpb9Im0ftufY1tb+TYFjTZHExMPKbefqPHGgdwX/XU3 X-Received: by 2002:a17:907:c286:b0:a46:5ac2:8506 with SMTP id tk6-20020a170907c28600b00a465ac28506mr296947ejc.25.1710385648142; Wed, 13 Mar 2024 20:07:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710385648; cv=pass; d=google.com; s=arc-20160816; b=0WHUSnpg13N357xlssuKCUFSGAt/AFgs2JBFtzfhqEoVrpRbSz7J5JC+6YrLpCy1fd YkL1qMC/jiVdwXCoQdWHn8wCOT5bZr3OJYw5nIliYdCIkk6pVawd7phOq2C60XyAGJVv n2JZjP13cYbVU0KIQzMfk9VtOnEmGD2ADLfO7oonwrbTk/Rs1tWaka1gG1k5KGoIjE3P CIMg3v2O9A1iAOUNk7yyWXi84pDW56xiRsaDvX0uNA0xWiZB3NzGUYXnIs2nvuIhMLvs UnjYdIjc2QvLdbCQl1aR4zuKuE27T0YzvI5FmqcAS3U+6jlMBKT+THCT2clnaivMzeTj C8lQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=PKQPZGd8S9cJ1ZJf8alUxzrEbC20jRp7iqZD7wVY8/0=; fh=7NZQ+e3iAE0l80z3DN2WtT+zyJkoP0b6z8WHxbiTmRs=; b=bWsi6mrScBgJu+U1ga6vHUse2z1I9o5yPYWMobt1SnODAktYAgJs9ZA0uwRyogMyJN r5cx6L32JzkehY7scnFWtt0y0dtBvRyIvZjf5ot6p835sfRoRUAc6oX2eBUYCpGwwun6 OD2tBaMglU/Lqbs/0Jg9kyeb5C19IZ/jBj2q4aNt/Q/rDCdmtWH05BROViilckSeMy2q 2qq1gQGw+elnYikHhqhVs6dbIeOt7gm9tvOR8zXV8je9tJju9LhKugekgKFmUe9P9IXm K+dn7T9ImVhJaRZollH9qqsomMc2mSpozzCO09OJldap4zFaWiE6fr/Tq173QxY6JrD3 b4Sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=i-love.sakura.ne.jp); spf=pass (google.com: domain of linux-kernel+bounces-102731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102731-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f23-20020a170906049700b00a3d526f83fdsi281663eja.367.2024.03.13.20.07.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 20:07:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=i-love.sakura.ne.jp); spf=pass (google.com: domain of linux-kernel+bounces-102731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102731-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5C5D71F24E6D for ; Thu, 14 Mar 2024 03:01:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D83D5256; Thu, 14 Mar 2024 03:01:40 +0000 (UTC) Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 472694A15 for ; Thu, 14 Mar 2024 03:01:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.181.97.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710385299; cv=none; b=UIRuV3JDm/OjLKMkuZu/HR6oVddFhKtUz2+VAUbLo1mwUbFM7aiHZ7o8F/FvWfHyVMfeSwHt2dhTQkl+RwtIkf91K7Tvt3cq+fwwSPWjmT59/tOy4Qxz4SpsUodwE5wBAswjixr+c+fsN7H1pqLO33X5TE9b0QhYIUb0bWWDtSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710385299; c=relaxed/simple; bh=Ii+1FAL2esZW333r1Jlft0rX1mqtsvQqoU8EiDoEjzY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=t3DJ9rP3QUJF/WEUwLNzv1gBNcfNlg46a+CwrdCoTD3VXefpjjUGcKDwfOwpNnTIFUDanF4vkLxjxk6Cxt3nTDwIjg6cFZEWEl9jMsK5fS46LiNwkrwr1K/LcRdYA1AWpwT6IS//5lcGVUSYoqtqlbfTTxyv7obCbSnlk8e9iLs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=I-love.SAKURA.ne.jp; spf=pass smtp.mailfrom=I-love.SAKURA.ne.jp; arc=none smtp.client-ip=202.181.97.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=I-love.SAKURA.ne.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=I-love.SAKURA.ne.jp 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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).