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=1796368408; b=10Z0FMRbesowXhUT8742uYuAy8DukTOH1aLZfWDlwS4D6IhH10o3YYe35+S6btmiKKmd qH6711H+RETgc1DNCLuoOFnWUpVp4bp1AVCKRVKXJC0/pP5euf0SVO3gVmPrBxntBP02b K5Gqo5YwLzOK1BcHfmgxii9hLXrt9hFmGVohARs5fNkCntuDfKrf9+42z0gTtq/bSvW8q B7d8rO1ujy0QmUQ9ScpqOtlO4kwVsQ2MLyTQxv8xLOBOphKp7daeRA1qz6A9o6ygrtD/i Hihx/sn09NJS7mbXRzWZCmfxzU93h1iYcTY8a5/9/tPXeh4V8CqBXeGISBt0yNDujcA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796368408; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=QH2Ft2+3pfbJMaivvBz5jdA/2REeh7PRo4Cg3OeZjJk=; b=U0ZOhytPvxGlyT4U7MoKqDScK1U58wS6tmZLqZwZxzLg3epitUVKrNxOvPw0ylsEjlfk aRwsmYMza+hwmKdvbpB3ml4gI57wEMql1IXNUGd6qwgwCa0qbj9KizKWnYKamHQKxtEXu z/77JX0A893dtiREuP1/Vo0Rikj6QC4PVB3b/dGEXNhAt4kvjOSdj/YiaPhyvH4W9bGve SW5e+kcKug9f6P2mXLbF9jTEkJVG67rf2udiyzRUOdOTroGNvvMThi9eAN+qyf7skqnCR SocBwDkUooe5EUYyBoZ6pZw2lw7bQ59Kr8X1lbyJQ50ZpWjpOd6zc+8DpwbKqLvxrlg== 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=RCbIkB4m; 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 BCBB5606A322 for ; Fri, 4 Dec 2026 07:13:28 +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=RCbIkB4m Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CEAF1F000C2; Fri, 4 Dec 2026 07:13:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796368408; bh=QH2Ft2+3pfbJMaivvBz5jdA/2REeh7PRo4Cg3OeZjJk=; h=Date:To:From:In-Reply-To:References:Subject; b=RCbIkB4m7yHE0eXN2eWFCGMgldqMZoXTszNdbi04CjzeLrxiXCEQ5tJVf0ElGl8WR Ne+29LazWU08ZfvS04y4iaIQtfIdDr5FfdN6+K7uasy2FRexsrQo6gTgFCl/lz/Y19 fiXy1lZVdB/Ux737zn5kU3CGGlTKklrTuNXklpJs= Date: Thu, 03 Dec 2026 23:13:27 -0800 To: mm-commits@vger.kernel.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261203-hugetlb_fixes_2-v2-18-9bbeabb555d2@kernel.org> References: <20261203-hugetlb_fixes_2-v2-18-9bbeabb555d2@kernel.org> Subject: + hugetlbfs-dont-overflow-the-end-of-the-unmap-range-on-32-bit-fix.patch added to mm-unstable branch Message-Id: <20261204071328.3CEAF1F000C2@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 patch titled Subject: hugetlbfs: correct the offset overflow comment has been added to the -mm mm-unstable branch. Its filename is hugetlbfs-dont-overflow-the-end-of-the-unmap-range-on-32-bit-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/hugetlbfs-dont-overflow-the-end-of-the-unmap-range-on-32-bit-fix.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Andrew Morton Subject: hugetlbfs: correct the offset overflow comment Date: Thu, 03 Dec 2026 22:52:58 -0800 The comment above vma_offset_start() says that neither offset helper can overflow on 32-bit. David's change to vma_offset_end() fixes the case which disproves that statement. Describe why the start offset stays within the VMA and why the end offset needs an explicit bounds check. Link: https://lore.kernel.org/r/20261203-hugetlb_fixes_2-v2-18-9bbeabb555d2@kernel.org Signed-off-by: Andrew Morton Suggested-by: Sashiko Link: https://lore.kernel.org/r/sashiko-outbox-247741@kernel.org fs/hugetlbfs/inode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/fs/hugetlbfs/inode.c~hugetlbfs-dont-overflow-the-end-of-the-unmap-range-on-32-bit-fix +++ a/fs/hugetlbfs/inode.c @@ -346,10 +346,10 @@ static bool hugetlb_vma_maps_pfn(struct } /* - * Can vma_offset_start/vma_offset_end overflow on 32-bit arches? - * No, because the interval tree returns us only those vmas - * which overlap the truncated area starting at pgoff, - * and no vma on a 32-bit arch can span beyond the 4GB. + * The interval tree returns only VMAs that overlap the range starting at + * start, so vma_offset_start() stays within the VMA on 32-bit. + * The end can lie far beyond the VMA. vma_offset_end() must check the + * page offset before converting it to an address. */ static unsigned long vma_offset_start(struct vm_area_struct *vma, pgoff_t start) { _ Patches currently in -mm which might be from akpm@linux-foundation.org are kselftest-mm-rename-read_pmd_pagesize-to-pmd_psize-fix.patch selftests-mm-check-madv_cold-and-madv_pageout-on-partly-advised-thps-fix.patch selftests-mm-retain-move-pmd-coverage-and-verify-huge-pmds.patch lib-test_xarray-check-unused-spare-node-after-range-creation.patch selftests-mm-check-that-fsync-reports-hard-poisoned-dirty-page-cache.patch selftests-mm-memory-failure-truncate-poisoned-fuse-page-cache-before-teardown.patch selftests-mm-memory-failure-skip-poisoned-dirty-page-cache-on-nilfs2.patch selftest-mm-memory-failure-keep-page-cache-files-linked-until-cleanup.patch selftest-mm-memory-failure-keep-page-cache-files-linked-until-cleanup-fix.patch selftests-mm-memory-failure-skip-hard-dirty-page-cache-test-on-cephfs.patch selftests-mm-memory-failure-close-dirty-page-cache-files-before-unlinking-them.patch selftests-mm-memory-failure-extend-page-cache-test-files-with-pwrite.patch selftests-mm-memory-failure-write-the-whole-page-cache-test-file-for-omfs.patch selftests-mm-memory-failure-accept-eio-from-close-after-poisoning-dirty-data.patch xarray-fix-index-jumping-backwards-in-xas_find_marked-fix.patch xarray-fix-index-jumping-backwards-in-xas_find_marked-fix-2.patch alloc_tag-introduce-ioctls-to-toggle-allocation-tracepoints-fix-fix.patch alloc_tag-introduce-ioctls-to-toggle-allocation-tracepoints-fix.patch mm-vmscan-scope-freeze-writeback-skip-to-the-reclaim-target.patch mm-vmscan-scope-freeze-writeback-skip-to-the-reclaim-target-fix.patch mm-hmm-refuse-secretmem-vmas-in-hmm_range_fault-fix.patch hugetlbfs-dont-overflow-the-end-of-the-unmap-range-on-32-bit-fix.patch ipc-msg-clamp-negative-msg_info-usage-counts.patch squashfs-fix-leaked-page-locks-when-page-actor-allocation-fails-fix.patch ocfs2-skip-network-flush-when-no-domain-handlers-are-registered.patch selftests-ptrace-check-that-ptrace_set_syscall_info-rejects-invalid-error-values-fix.patch lib-atomic64-separate-hashed-locks-by-smp-cache-line.patch nvdimm-btt-separate-map-locks-by-smp-cache-line.patch percpu_ref-replace-the-global-switch-lock-with-hashed-locks-fix.patch afs-do-not-put-error-pointer-after-address-lookup-failure.patch drivers-media-v4l2-core-v4l2-vp9c-reduce-inlining.patch