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=1796380804; b=rikUSohqb7lCgE7JFGsLdg7MAPpvzxXS6EnbUrLx5ODzdosnmBfvMyd6u8OsZRFTViIO zC/HcCC5V174XtHq47T0LkVPN//T9oN7CJu8+IEgRvh0p+SaCKfXFnWsk/kfc2n3wVWC4 cUy98pZRiaDbGjPKObcZdzEC4lz4DUClHXamNhYetmp+3TEUlnG2rk5RhxJdc/6r1xO4D RjC0ckbuZEguL3Mjknu+mUA8V6SdXxW6iEEmjei2Mu7Zbp0e00Sb6567qOTU1JDCLQLaJ rnVtP/f+rBCEvpu9wTrijDFjxRb+8Nb2U+bvqAXJQMAu3w3mpOnsUaZ6GXZfjj1gD7A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380804; 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=NAezsC/nRHG0jBZM3/ZQlbMGBUpeOxjwFInZ0+VVQ9k=; b=tukUxGUIjQMGrTv4Fkit781pIurQW0AtqNZpweylV1AI8d8jME6/uYeuFiDw1e8poFj5 RxQ2vtdK/aeOLSHvOFg0SUxjPlafm2CPEhuF8V3Rj2Hy0Qya86PG/lh8PKPM0kw9qWWvc VKCWnL1X0o08dDlsJ5AApEUUIxLnaovueSuhMcqMLWtsevH1KYxj/tu4IeJX+4YQTRwzG blQz4Fh/a8bPUhoqkfW6/HevAT6Is0meee+bJKNVlHFURn82xQLcloT6Py7DhhD1qQAew 8zFvlaV3hCiU7tmWXi5d4FQO5TQlTOLhIqF/xCUIG4rt838rgQX3r548g0uWzsHEvHQ== 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=L8o8tpiy; 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 4892D606A33E; Fri, 4 Dec 2026 10:40:04 +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=L8o8tpiy Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DBB21F00934; Fri, 4 Dec 2026 10:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380804; bh=NAezsC/nRHG0jBZM3/ZQlbMGBUpeOxjwFInZ0+VVQ9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=L8o8tpiyDxeWqhOn68+GRkW+479FyqnjwxdbvuG1IN/uttp0NTo7aSU+sCm/HAhjF dnQncqWc6lmA52DtFBVHJNe37+mTicqFNsmXEbh0vH0GLdN4dOoxDoIm1mlRz1/jKj jfJvFkif2fl0pYJWs892KZW4M4Z7Nq7KXRjdiM/8= 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 7.3 430/742] arm64/mm: fix destructor for unconstructed hotplug page tables Date: Fri, 4 Dec 2026 19:04:54 +0900 Message-ID: <20261204100646.530806284@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev 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 7.3-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 @@ -1495,8 +1495,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,