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=1796324387; b=LSu3FSXofKY53P9OX/4jLrA25swcd2z4i1G5XC2gJhgE9dI6Djx50Wbjy7gigSpfyXdy mWJLkB3NjVf1PGRxC/zJ7xI0BXEb32hMOb8GxY0oYMVlYMS+Qssp8Z7P0xGvC4EZwBx8Z YAeO00K7GpkXuakOuudh9j3jo0/Quzdkf5aXY5QlHjPLgVVStAN/MBBXVlXhklgG7zoYA DAMUBvmaG6efhrRAD1jMN0JnKYy2G0Q4fWTrCixHlYqo2qoIWlLKeUJ+vPqfTFAhyIj2V nixZ67jOe2sRCxnPhaHl8lArF8PE6CK/NGHfq0eZVGGJO14itO1oYMicEG4RL6GFVPw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796324387; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=v289YDJMzmclA+HbiWlQ4OiBBthRkx+Bjn9PhrGtwFE=; b=SUSd2/3vaJ42JRyXo6e5rMkHdu/muIqKW4mocuDrTzUURefcMhhaKPvRybAxOjJvOo0P 356LkTDzLlz75xPCTw2LDAGvAAmNzvSq9qydmgfnVZ0EUSj3s+/NCg2UCEmx0tXzWEr5V j2ZTMDY9r/A+McucswjT+/K2iC681gY36ci60CDPeqvlQFi+oQydkuEmABPKacQJa9lw+ ofIbTH/2W9YGKILwJVoM9Fcb4EeCMkhT12yyYqHE1AUcsD+sI+fLYVLDq7FYdT3bYZbNn 8eSQxl2apUNnZ9y85xpFxNjv1NWLGrfdFqRSbbxFp94Ndh5bzwl7BAybJf3iJ3wPsvg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=DvTZHyqB; 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 BD3A3606A322 for ; Thu, 3 Dec 2026 18:59:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=DvTZHyqB Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AC5B1F000C1; Thu, 3 Dec 2026 18:59:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796324387; bh=v289YDJMzmclA+HbiWlQ4OiBBthRkx+Bjn9PhrGtwFE=; h=Date:To:From:In-Reply-To:References:Subject; b=DvTZHyqBF82He+yanvl3flDAVSIsJb3rdFPSbpD8e8qwPACUP9YJ8UjGUq3BPe48N xWK6QKM5QAPGPlM/O7/Trm6xJxLt8une886pgiEMaGcYaYHuZqlJ9U7dFOkT1ZDrME +0rS/idGxfc+wMfw75hk2HDZDoug/znLAn5qavaE= Date: Thu, 03 Dec 2026 10:59:46 -0800 To: mm-commits@vger.kernel.org,mason@kernel.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261125-hugetlb_fixes_2-v1-2-db27fd2f71a8@kernel.org> References: <20261125-hugetlb_fixes_2-v1-2-db27fd2f71a8@kernel.org> Subject: [to-be-updated] mm-hugetlb-fix-truncated-copy-result-in-uffdio_copy.patch removed from -mm tree Message-Id: <20261203185947.2AC5B1F000C1@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The quilt patch titled Subject: mm/hugetlb: fix truncated copy result in UFFDIO_COPY has been removed from the -mm tree. Its filename was mm-hugetlb-fix-truncated-copy-result-in-uffdio_copy.patch This patch was dropped because an updated version will be issued ------------------------------------------------------ From: Chris Mason Subject: mm/hugetlb: fix truncated copy result in UFFDIO_COPY Date: Wed, 25 Nov 2026 23:33:00 +0100 Patch series "mm/hugetlb: various fixes (2)". Some more hugetlb fixes, this time not as horrible and confusing stuff as last time: - Patch #1 - #17: a bunch of non-urgent fixes - Patch #18 - #19: two related improvements - Patch #21: an RFC for a hugetlb cgroup fix This patch (of 19): Folios that span more bytes than can fit into an unsigned integer (e.g., 16 GiB folios on arm64) are problematic with UFFDIO_COPY: the result from copy_folio_from_user() can be truncated, possibly indicating success instead of an error. We will then continue with the folio that has stale data, and make it accessible to user space. For example, if copy_folio_from_user() fails such that the number of bytes not copied is a multiple of 4 GiB, we'll get an effective ret == 0. Let's fix it by simply testing the return value directly. This has medium urgency, as it's an information leak. [david@kernel.org: cleanup code and description] Link: https://patch.msgid.link/20261125-hugetlb_fixes_2-v1-2-db27fd2f71a8@kernel.org Fixes: 8fb5debc5fcd ("userfaultfd: hugetlbfs: add hugetlb_mcopy_atomic_pte for userfaultfd support") Signed-off-by: Chris Mason Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Andrew Morton Reviewed-by: Oscar Salvador (SUSE) Reviewed-by: Hongfu Li Reviewed-by: Muchun Song (ByteDance) Cc: Oscar Salvador Cc: Jinmeng Zhou Cc: Andrea Arcangeli Cc: Naoya Horiguchi Cc: Hugh Dickins Cc: Baolin Wang Cc: Dave Airlie Cc: Vivek Kasireddy Cc: Gerd Hoffmann Cc: Mike Rapoport Cc: Mel Gorman Cc: Dave McCracken Cc: Andy Whitcroft Cc: Adam Litke Cc: Lorenzo Stoakes Cc: Rik van Riel Cc: Liam R. Howlett Cc: Vlastimil Babka Cc: Harry Yoo Cc: Jann Horn Cc: Lance Yang Cc: James Houghton Cc: Yang Shi Cc: Suren Baghdasaryan Cc: Shakeel Butt Cc: Pedro Falcato Cc: Gregory Price Cc: Zi Yan Cc: Joshua Hahn Cc: Rakie Kim Cc: Ying Huang Cc: Matthew Brost Cc: Byungchul Park Cc: Alistair Popple Cc: Wanpeng Li Cc: Andi Kleen Cc: Kenneth W Chen Cc: Michal Hocko Cc: David Rientjes Cc: Joern Engel Cc: Jonathan Corbet Cc: Shuah Khan Cc: Randy Dunlap Cc: Aneesh Kumar K.V Cc: KAMEZAWA Hiroyuki Cc: Kiryl Shutsemau Cc: Sasha Levin Cc: Guillaume Morin Cc: Jason Gunthorpe Cc: luojiajun Cc: Josef Bacik Cc: Daehyeon Ko <4ncienth@gmail.com> Cc: Ackerley Tng Cc: Jiaqi Yan Cc: mm/hugetlb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/mm/hugetlb.c~mm-hugetlb-fix-truncated-copy-result-in-uffdio_copy +++ a/mm/hugetlb.c @@ -6545,11 +6545,8 @@ int hugetlb_mfill_atomic_pte(pte_t *dst_ goto out; } - ret = copy_folio_from_user(folio, (const void __user *) src_addr, - false); - /* fallback to copy_from_user outside mmap_lock */ - if (unlikely(ret)) { + if (unlikely(copy_folio_from_user(folio, (const void __user *)src_addr, false))) { ret = -ENOENT; /* Free the allocated folio which may have * consumed a reservation. _ Patches currently in -mm which might be from mason@kernel.org are mm-swap-fix-large-swap-in-across-swap-file-extents.patch hugetlbfs-do-not-grow-a-sealed-file-in-mmap.patch mm-hugetlb-keep-surplus-folios-that-are-reserved.patch mm-hugetlb-fix-reservation-leak-on-min_size=-mounts.patch mm-cachestat-count-each-page-only-once.patch mm-cachestat-restart-the-walk-after-each-entry.patch percpu-queue-the-balance-work-on-an-unbound-workqueue.patch mm-vma-fix-uncharge-after-failed-stack-relocation.patch mm-mremap-apply-the-mmap-offset-limits-on-expansion.patch mm-mremap-respect-guard-gaps-on-in-place-expansion.patch mm-vma-make-brk-mappings-non-executable-under-mdwe.patch kfence-use-a-nofault-store-to-zero-the-guard-page.patch mm-filemap-update-the-folio-order-range-atomically.patch mm-userfaultfd-account-memory-allocated-for-unmap-events.patch mm-userfaultfd-drop-fork-context-reference-outside-event_wqhlock.patch mm-madvise-dont-declare-oom-for-madv_willneed-swapin.patch mm-mprotect-fix-unpaired-notifier-start-at-address-0.patch mm-hmm-refuse-secretmem-vmas-in-hmm_range_fault.patch mm-mglru-count-all-generations-as-evictable.patch mm-mglru-test-pg_lru-before-taking-a-folio-reference.patch mm-mglru-report-root-reclaim-to-memorypressure_level.patch hugetlbfs-fix-deadlock-between-hole-punching-and-memory-failure.patch hugetlbfs-recheck-the-vma-range-after-the-lock-wait.patch mm-hugetlb-dont-zap-non-present-entries-when-unmapping-a-folio.patch mm-hugetlb-unshare-pmds-of-a-split-vma-if-allocating-its-lock-fails.patch mm-hugetlb_cgroup-track-in-use-folios-per-cgroup.patch hugetlbfs-seal-shm_hugetlb-files-against-growth.patch mm-hugetlb-resolve-protnone-faults-without-a-uffd-bit.patch a.patch