From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4F7832EBDF2; Thu, 27 Nov 2025 19:33:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764272020; cv=none; b=NIZUIdHswkpM1cNkXuydMLR9e/9zkqZvnBvJ39zfnsE6sT4yDn89wcsDz/FFpaunKGc304sVmXmMbI/b1qtgJlN8YN/hyLoqrUYrPpE3zT8f/pegQk26OJC0HE5MR+loRBlTrUE266U4u1ZyAke7Lf3FW+URpZVyFPjWO1WFrZ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764272020; c=relaxed/simple; bh=bKwbRmbrl+X8raFsxUCv3iqsRGv3g/qP8jWuzhz/5xo=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=cp9TYjzHPPVwoBljOxZ2yegluto7PD3bodLA0biw29bAn9Ed1m4xSr0s866Hd+yJnG3rmrT1W9fCfw0Tv5HY1Ukk0T9LsNiHyFatD9LkTzMCkauZyL+dvZzL0VDYBhV0qo7Vgvf0MeyYYLkmUlI/yq08feJLfjCWj+kEgLv+baA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=C82VoaDh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="C82VoaDh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9F48C4CEF8; Thu, 27 Nov 2025 19:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1764272019; bh=bKwbRmbrl+X8raFsxUCv3iqsRGv3g/qP8jWuzhz/5xo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=C82VoaDhd0sLSQSLoV+c3099bDHqryfKIwdPCaSkPbMob2hxR6Mo96WsptlVjIgXk uP97+DGgersxABmCaWxwVwO/9cRncMCk679v0utJXbOe3eUAoBEmHyUK962izBaUuz ghigxFj1nYps4+6cypgfSmpBaKlAIGYwIYKpVSas= Date: Thu, 27 Nov 2025 11:33:37 -0800 From: Andrew Morton To: Lorenzo Stoakes Cc: Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Sven Schnelle , Peter Xu , Alexander Viro , Christian Brauner , Jan Kara , Arnd Bergmann , Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Muchun Song , Oscar Salvador , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Gregory Price , Ying Huang , Alistair Popple , Axel Rasmussen , Yuanchu Xie , Wei Xu , Kemeng Shi , Kairui Song , Nhat Pham , Baoquan He , Chris Li , SeongJae Park , Matthew Wilcox , Jason Gunthorpe , Leon Romanovsky , Xu Xin , Chengming Zhou , Jann Horn , Miaohe Lin , Naoya Horiguchi , Pedro Falcato , Pasha Tatashin , Rik van Riel , Harry Yoo , Hugh Dickins , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, damon@lists.linux.dev Subject: Re: [PATCH v3 14/16] mm: remove is_hugetlb_entry_[migration, hwpoisoned]() Message-Id: <20251127113337.c6a897e0b786d56084d23025@linux-foundation.org> In-Reply-To: <66178124-ebdf-4e23-b8ca-ed3eb8030c81@lucifer.local> References: <0e92d6924d3de88cd014ce1c53e20edc08fc152e.1762812360.git.lorenzo.stoakes@oracle.com> <66178124-ebdf-4e23-b8ca-ed3eb8030c81@lucifer.local> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 27 Nov 2025 17:45:17 +0000 Lorenzo Stoakes wrote: > Hi Andrew, > > Please apply this fix. > The offending patch is in mm-stable now, so I'll do this as a hey-git-made-me-add-a-bisection-hole commit. From: Lorenzo Stoakes Subject: fs/proc/task_mmu.c: fix make_uffd_wp_huge_pte() huge pte handling Date: Thu, 27 Nov 2025 17:45:17 +0000 make_uffd_wp_huge_pte() should return after handling a huge_pte_none() pte. Link: https://lkml.kernel.org/r/66178124-ebdf-4e23-b8ca-ed3eb8030c81@lucifer.local Fixes: 03bfbc3ad6e4 ("mm: remove is_hugetlb_entry_[migration, hwpoisoned]()") Signed-off-by: Lorenzo Stoakes Reported-by: Vlastimil Babka Closes: https://lkml.kernel.org/r/dc483db3-be4d-45f7-8b40-a28f5d8f5738@suse.cz Signed-off-by: Andrew Morton --- fs/proc/task_mmu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/proc/task_mmu.c~fs-proc-task_mmuc-fix-make_uffd_wp_huge_pte-huge-pte-handling +++ a/fs/proc/task_mmu.c @@ -2500,9 +2500,11 @@ static void make_uffd_wp_huge_pte(struct const unsigned long psize = huge_page_size(hstate_vma(vma)); softleaf_t entry; - if (huge_pte_none(ptent)) + if (huge_pte_none(ptent)) { set_huge_pte_at(vma->vm_mm, addr, ptep, make_pte_marker(PTE_MARKER_UFFD_WP), psize); + return; + } entry = softleaf_from_pte(ptent); if (softleaf_is_hwpoison(entry) || softleaf_is_marker(entry)) _