From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 3157E30EF7E; Tue, 21 Jul 2026 19:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784663728; cv=none; b=i+SX7Rfn1p5r/PGWw5doZ47OjlyOryeidv+2vyxdcRg/wFL75Az64bzJlZH9+eC0v551VAQz9etoZU666EtOcDrCgGn64+wC2IMpXO9SdlTbCI4TZAOrjWQMwtw1+p9VNMubAj/AqgU/JqAL0DypC8kPt4+JryOmMid7KNAROcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784663728; c=relaxed/simple; bh=NW0vydcwcUwppmhegPauY2/2b0Tpv6GyERNBgdu5slo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ALaVwYSesuqEe7/lPBZGBPwCE0hMuxZAfurSrd9STmum9nLlyU9DyMiAONa+sBuSSL7St6YaucXn/V6pwVeuGI97BfYPNhmQETElYMkP+Zk4FYdzCUHQ5g7CdKB+CdIM7ZVyZ//j2NFcDct0ZSRWuVcaVTOBJbHVHsWt62NIMT0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZXMrXTO6; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZXMrXTO6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5836E1F000E9; Tue, 21 Jul 2026 19:55:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784663726; bh=/r24/PiXE9iszHA1JIq82LkpoByeNjhoKvnizoDU4pA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZXMrXTO6cAXDuBUOP+tzR+QtHxd+778QZNoEcxn2LsaYtWJP1XJe2KttxI/zqt6fD NOlPIkjcPTuFNK61cm1xkOYBU63OvkykpL7YSMfLfyY49449IqRb4rrqEN4TNZTK4m Qz1mQxCWrUxg54Qa2aBDBdUpyhlbVPpC+VcHO2Do= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kiryl Shutsemau , Sashiko AI review , Lorenzo Stoakes , Dev Jain , David Hildenbrand , Michal Hocko , Mike Rapoport , Peter Xu , Suren Baghdasaryan , Vlastimil Babka , Balbir Singh , Andrew Morton Subject: [PATCH 6.12 0933/1276] fs/proc/task_mmu: use huge_page_size() in pagemap_scan_hugetlb_entry() Date: Tue, 21 Jul 2026 17:22:56 +0200 Message-ID: <20260721152506.909945481@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152446.065700225@linuxfoundation.org> References: <20260721152446.065700225@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kiryl Shutsemau (Meta) commit 1b074e3270e1c061c829150c742eb83bad4dddd1 upstream. The partial-page check compares against HPAGE_SIZE (PMD_SIZE), which is wrong for gigantic hugetlb hstates (e.g. 1G). The walker hands the callback a huge_page_size()-sized range, never start + HPAGE_SIZE, so the comparison always declares it partial and aborts the WP. Compare against the actual hstate's page size. Link: https://lore.kernel.org/20260529172331.356655-3-kas@kernel.org Fixes: 52526ca7fdb9 ("fs/proc/task_mmu: implement IOCTL to get and optionally clear info about PTEs") Signed-off-by: Kiryl Shutsemau Reported-by: Sashiko AI review Reviewed-by: Lorenzo Stoakes Reviewed-by: Dev Jain Cc: David Hildenbrand Cc: Michal Hocko Cc: Mike Rapoport Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Balbir Singh Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- fs/proc/task_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -2606,7 +2606,7 @@ static int pagemap_scan_hugetlb_entry(pt if (~categories & PAGE_IS_WRITTEN) goto out_unlock; - if (end != start + HPAGE_SIZE) { + if (end != start + huge_page_size(hstate_vma(vma))) { /* Partial HugeTLB page WP isn't possible. */ pagemap_scan_backout_range(p, start, end); p->arg.walk_end = start;