From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382300; b=DvjHrPKr8xwqBjkkJs3KG6H1cqCK2nw7BCfKeFA6pjvkjsc9gsP2PpAIeom2fcNCLaA0 0UwXL5brroRBRJOyzKXJSx9uBUBfEoahpJIPu/XJgyLoUryabS2NvfyLXpN9OpV7Wqsa7 oPJjqdTst2yqJ6Ds86VNVn2eusdXr7BqTZFnUSFMotPxa0bDacy9fgD9wZ80kGLKYOvPf EtF2rq5RbDfbka6I1iyTgY/ZfZP41ZcgL2PQyZKbb/w4s0p+jtZXUBGP7qd3N1ecaTAFe FHG0xjFPBH/BUisL91Kv6/X/5jTydFRosECujOFyoeU4w2gF+/t6RvhonCr+UEZQ5IQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382300; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=T9pRwZ9cIh3n1eUO+TDirMYfeoEOqJt4E+tsVCRDsVY=; b=bxdnRkT+r02cikksqUGnyu1OlDB6PXHRQL1ALozfhiHJuZMGdUPlYIInHu18sygyJ8S1 HmG791JWEO+wgB3LGPsT6fcis+RxhEiANXXJWUzzu+q09wXgeNx0jTHEMPMd/BuJMGfVN U/MskCh4yf8HOK98THcKykX/9TsUFvVWs9uQXNCzrV5XMeYEtskom3bMB3xWoaF/8F1g/ Fdb+DHRV8kOcwjQaQH47sODaxbIqBRB4RYPXikSfCPo7vrQcgiwSmObN/tvLBrL8rcjJJ Ezbx7VneEp2qHvRLRcypTR4JyvX/SYTze7Kz5mo1+/xqFMA+E1vd+aFfOIkXci333WQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="BOX/+pI9"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17191606A322; Fri, 4 Dec 2026 11:04:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=BOX/+pI9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28B161F000C2; Fri, 4 Dec 2026 11:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382299; bh=T9pRwZ9cIh3n1eUO+TDirMYfeoEOqJt4E+tsVCRDsVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BOX/+pI92fqh2q35L3yLNBumlxNd88bCZNiTErcO8b/gifYevHWJLXvLJu7+xO6yP HOZ1LrFB3gnbJSfZ1BIs1kMxID2or81O7iFEGq7h2MWCWZ5Tw94nlbIbWbvTD08jul kr94azNWDURBFtRFyDP8jNo43wXG7Vyhuk4AGIB4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Muchun Song , Andrew Morton , Kevin Brodsky , "David Hildenbrand (Arm)" , Anshuman Khandual , Catalin Marinas , Oscar Salvador , Dave Hansen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Will Deacon , Mark Rutland , Alexander Gordeev , Alistair Popple Subject: [PATCH 6.18 393/703] arm64/mm: fix destructor for unconstructed hotplug page tables Date: Fri, 4 Dec 2026 19:04:52 +0900 Message-ID: <20261204100638.290074697@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Muchun Song commit 26601a6c80c52c5336cd02b3379710077aeafc4a upstream. Commit c594b83457cc ("arm64: mm: call pagetable dtor when freeing hot-removed page tables") made free_hotplug_pgtable_page() unconditionally run the page-table destructor. This matches page tables allocated by the arm64 mapping code, which runs the corresponding constructors. However, arm64 also uses the generic sparse-vmemmap population code. Runtime intermediate page tables allocated by that code do not run a page-table constructor. Freeing one during memory hot-remove therefore runs a destructor without a matching constructor and corrupts NR_PAGETABLE accounting. Free intermediate page-table pages through pagetable_free(). It runs the destructor only for constructor-backed pages and then releases the page through the page-table freeing path. Link: https://lore.kernel.org/20261023063428.3658761-5-songmuchun@bytedance.com Fixes: c594b83457cc ("arm64: mm: call pagetable dtor when freeing hot-removed page tables") Signed-off-by: Muchun Song Signed-off-by: Andrew Morton Reviewed-by: Kevin Brodsky Acked-by: David Hildenbrand (Arm) Reviewed-by: Anshuman Khandual Reviewed-by: Catalin Marinas Cc: Oscar Salvador Cc: Dave Hansen Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Alexandre Ghiti Cc: Björn Töpel Cc: Will Deacon Cc: Mark Rutland Cc: Alexander Gordeev Cc: Alistair Popple Cc: Signed-off-by: Greg Kroah-Hartman --- arch/arm64/mm/mmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1459,8 +1459,7 @@ static void free_hotplug_page_range(stru static void free_hotplug_pgtable_page(struct page *page) { - pagetable_dtor(page_ptdesc(page)); - free_hotplug_page_range(page, PAGE_SIZE, NULL); + pagetable_free(page_ptdesc(page)); } static bool pgtable_range_aligned(unsigned long start, unsigned long end,