From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E15E7606A31E for ; Fri, 30 Oct 2026 00:20:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=vJUdGkif; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OMv7mkSB DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=gUNDzrcBQCofjPtOZhO0zF/6BwtiodHnLN9kfJEdKls=; b=vJUdGkifen4Xcr nBN2sfPmAtGWTD7SW6o2fAot6YlhZcduYlblFp4NUkv83ekDq5PDxQahpdhr6dKIb1P2AmBYUiEIc 1dBDopeDcdkfUjXY+yiokG5zIPsAequUqYhmWoLnBVDd+gbvXYqYHl8VAIfRMY1Ii71kg7/HsxZqu aNdOPXXOuTLReU0oN895a9LYcIDoGTfvfx93R2H698vxN5aKjDcT5Hwf49dmW+aa4Lw4wultzk4cL /QqQ2/CqUPdCIdAZrSM44xqbiHK1sq4HvDLK+hIr47DsIS0DRQvyIbJFr3XljRLveGR5Q3ASvR8j8 +3sxPdHv4f9ZyycQhtZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xMaLx-0000000AZXz-0nYe; Fri, 30 Oct 2026 00:20:17 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xMaLu-0000000AZXr-20FJ for kexec@lists.infradead.org; Fri, 30 Oct 2026 00:20:14 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 7569943923; Fri, 30 Oct 2026 00:20:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E86C1F000C1; Fri, 30 Oct 2026 00:20:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793319613; bh=gUNDzrcBQCofjPtOZhO0zF/6BwtiodHnLN9kfJEdKls=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OMv7mkSB943eqjxfOdTCTqRn8rnHCaFZTrdaPeB0aIFCob3E3fqLF62qDpAEPjHQA B3xh+10xm0pLuUYynSQpI6Nhgsdy13RCNCEvL/EsGdSb7FWvxPCUQBVJ/KVoki3Q3j A7o8d2rcIlBgQP9lheaOYTIDrvi9q3rsoE+zz/ApHV8bjiyRYYLLaUYBuhT5JdA0R1 w7mbCA1lQdx5BakPTjA+ZD87OkbCVKcnrx9v8R9+8bKdOhFqSO1ssMBMBUYRkSn/Kv BpHEmrr7LDOBQR8TBi9SkI1IJdsaRv8CC3SznbrHhfqdDWrNhiMX7QP/0o/p/4lUxU b2bHyvWufwEuQ== From: SJ Park To: "David Hildenbrand (Arm)" Cc: SJ Park , Johannes Weiner , Michal Hocko , Qi Zheng , Shakeel Butt , Lorenzo Stoakes , Kairui Song , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Baoquan He , Baolin Wang , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Kees Cook , Peter Zijlstra , Jann Horn , Pedro Falcato , Hugh Dickins , Pasha Tatashin , Pratyush Yadav , "Matthew Wilcox (Oracle)" , Jan Kara , Zi Yan , Lance Yang , Rik van Riel , Harry Yoo , Alistair Popple , Nico Pache , Ryan Roberts , Dev Jain , Usama Arif , Kiryl Shutsemau , Matthew Brost , John Hubbard , Peter Xu , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Oscar Salvador , Minchan Kim , Muchun Song , Xu Xin , Chengming Zhou , Chris Li , Kemeng Shi , Nhat Pham , Youngjun Park , Gregory Price , Joshua Hahn , Rakie Kim , Ying Huang , Jason Gunthorpe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-cxl@vger.kernel.org, Josef Bacik , stable@vger.kernel.org, Muhammad Usama Anjum Subject: Re: [PATCH v2 01/47] mm/mglru: don't use stack pointers when walking PUD and PMD tables Date: Thu, 29 Oct 2026 17:20:03 -0700 Message-ID: <20261030002004.154595-1-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261029-fixes_core-v2-1-a64ce7f83abb@kernel.org> References: X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 'get_maintainer.pl --nogit --nogit-fallback' suggests adding below recipients. But I can show there are already quite a number of recipients, so I'm just noting here. - Brian Geffon - Oleksandr Natalenko - Steven Barrett - Yu Zhao On Thu, 29 Oct 2026 21:32:56 +0100 "David Hildenbrand (Arm)" wrote: > From: Josef Bacik > > MGLRU passes stack copies of page-table entries in walk_pud_range() and > walk_pmd_range() when walking to the next level. These copies can become > stale when khugepaged or MADV_DONTNEED (CONFIG_PT_RECLAIM) removes a PTE > table concurrently. > > This pattern dates back to commit bd74fdaea146 ("mm: multi-gen LRU: > support page table walks"). Likely, earlier locking masked the latent > bug. Later changes exposed it: commit 1d65b771bc08 ("mm/khugepaged: > retract_page_tables() without mmap or vma lock") allowed concurrent > retraction, and commit cf4a65539c13 ("memcg-v1: no need for memcg locking > for MGLRU") dropped the walker's outer RCU protection. > > The fix is simple, so just fix the original commit so we don't have to > speculate. To fix it, pass the actual PMD/PUD pointers. This restores the > RCU-protected lookup and validation against the live PMD. Note that the PUD > handling is required as well to handle folded page tables correctly in all > cases. > > Fix generated by an LLM and sent by Josef Bacik in private. > > [ david: handle walk_pud_range() as well, clarify+simplify description, > adjust Fixes: ] Looks all good to me. > > Fixes: bd74fdaea146 ("mm: multi-gen LRU: support page table walks") > Cc: stable@vger.kernel.org > Signed-off-by: Josef Bacik > Reviewed-by: Rik van Riel > Reviewed-by: Qi Zheng > Reviewed-by: Dev Jain > Reviewed-by: Lorenzo Stoakes (ARM) > Reviewed-by: Kairui Song > Tested-by: Muhammad Usama Anjum > Reviewed-by: Harry Yoo (Meta) > Reviewed-by: Barry Song > Reviewed-by: Baolin Wang > Reviewed-by: Pedro Falcato > Reviewed-by: Kiryl Shutsemau (Meta) > Signed-off-by: David Hildenbrand (Arm) Reviewed-by: SJ Park Thanks, SJ [...]