From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,vbabka@kernel.org,surenb@google.com,
sj@kernel.org,shakeel.butt@linux.dev,pfalcato@suse.de,mawupeng1@huawei.com,
liam@infradead.org,jannh@google.com,dingf3ng@gmail.com,david@kernel.org,
ljs@kernel.org,akpm@linux-foundation.org
Subject: [merged mm-hotfixes-stable] mm-msync-return-enomem-if-page-aligned-length-overflows.patch removed from -mm tree
Date: Tue, 01 Dec 2026 19:47:51 -0800 [thread overview]
Message-ID: <20261202034751.F1F311F000C1@smtp.kernel.org> (raw)
In-Reply-To: <20261120-msync-enomem-fix-v1-1-80282c8c5beb@kernel.org>
The quilt patch titled
Subject: mm/msync: return -ENOMEM if page-aligned length overflows
has been removed from the -mm tree. Its filename was
mm-msync-return-enomem-if-page-aligned-length-overflows.patch
This patch was dropped because it was merged into the mm-hotfixes-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Subject: mm/msync: return -ENOMEM if page-aligned length overflows
Date: Fri, 20 Nov 2026 10:59:56 +0000
Currently the msync() system call will simply return 0 if you provide a
length parameter which, when page-aligned (rounding up) overflows (i.e.
SIZE_MAX - n, where n is in the range [0, PAGE_SIZE - 1).)
This requires broken input, and nobody has complained about this, but for
correctness this should really return -ENOMEM, so do so.
Also, since error is assigned within the following loop, remove the
unnecessary assignments prior to it.
Link: https://patch.msgid.link/20261120-msync-enomem-fix-v1-1-80282c8c5beb@kernel.org
Link: https://lore.kernel.org/linux-mm/20230321074035.1526157-5-mawupeng1@huawei.com/
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Ding Feng <dingf3ng@gmail.com>
Closes: https://lore.kernel.org/linux-mm/20261120051413.46167-1-dingf3ng@gmail.com/
Reviewed-by: SJ Park <sj@kernel.org>
Reviewed-by: Wupeng Ma <mawupeng1@huawei.com>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Jann Horn <jannh@google.com>
mm/msync.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
--- a/mm/msync.c~mm-msync-return-enomem-if-page-aligned-length-overflows
+++ a/mm/msync.c
@@ -46,14 +46,12 @@ SYSCALL_DEFINE3(msync, unsigned long, st
goto out;
if ((flags & MS_ASYNC) && (flags & MS_SYNC))
goto out;
- error = -ENOMEM;
+ if (!len)
+ return 0;
len = (len + ~PAGE_MASK) & PAGE_MASK;
end = start + len;
- if (end < start)
- goto out;
- error = 0;
- if (end == start)
- goto out;
+ if (end <= start)
+ return -ENOMEM;
/*
* If the interval [start,end) covers some unmapped address ranges,
* just ignore them, but return -ENOMEM at the end. Besides, if the
_
Patches currently in -mm which might be from ljs@kernel.org are
mm-vma-predicate-vma_assert_stabilised-on-config_debug_vm.patch
mm-only-assert-mmap-locks-if-config_debug_vm-or-lockdep-is-set.patch
mm-only-assert-vma-locks-if-config_debug_vm-is-set.patch
mm-convert-warn_on_onces-to-vm_warn_on_once-in-vma-lock-code.patch
mm-madvise-zap-markers-from-guard-regions.patch
mm-mmap-free-gathered-pages-before-mmf_oom_skip.patch
percpu-fix-contig-hints-that-are-too-low.patch
percpu-search-the-whole-reserved-chunk.patch
xen-privcmd-convert-mmap-hook-to-mmap_prepare.patch
kvm-ppc-book3s-convert-spapr-tce-mmap-hook-to-mmap_prepare.patch
mshv_vtl-convert-mmap-hooks-to-mmap_prepare.patch
x86-sgx-convert-vepc-mmap-hook-to-mmap_prepare.patch
udf-convert-mmap-hook-to-mmap_prepare.patch
selinuxfs-convert-mmap-hooks-to-mmap_prepare.patch
xen-convert-xenstore-interface-mmap-hooks-to-mmap_prepare.patch
soc-aspeed-convert-lpc-and-p2a-control-mmap-hooks-to-mmap_prepare.patch
soc-qcom-rmtfs_mem-convert-mmap-hook-to-mmap_prepare.patch
tee-convert-shm-mmap-hook-to-mmap_prepare.patch
misc-bcm-vk-convert-mmap-hook-to-mmap_prepare.patch
ptp-vmclock-convert-mmap-hook-to-mmap_prepare.patch
vhost-vdpa-convert-mmap-hook-to-mmap_prepare.patch
mm-vma-error-out-on-invalid-bounds-in-unmapped_area_topdown.patch
mm-vma-lock-vmas-before-taking-mm_all_locks_mutex.patch
mm-filemap-convert-fault-and-readahead-logic-to-use-vma_flags_t.patch
mm-madvise-convert-madvise_vma_behavior-to-use-vma_flags_t.patch
mm-convert-miscellaneous-vma-flag-tests-to-use-vma_flags_t.patch
fs-proc-task_mmu-convert-vma-flag-tests-to-use-vma_flags_t.patch
fs-coredump-convert-vma_dump_size-to-use-vma_flags_t.patch
uprobes-convert-vma-flag-tests-to-use-vma_flags_t.patch
perf-convert-vma-flag-tests-to-use-vma_flags_t.patch
selinux-convert-vma-flag-tests-to-use-vma_flags_t.patch
apparmor-convert-vma-flag-tests-to-use-vma_flags_t.patch
ima-convert-vma-flag-tests-to-use-vma_flags_t.patch
ipe-convert-vma-flag-tests-to-use-vma_flags_t.patch
coda-never-point-a-files-f_mapping-at-a-containers-mapping.patch
fs-proc-task_mmu-write-protect-only-with-ptrace-attach.patch
prev parent reply other threads:[~2026-12-02 3:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 10:59 [PATCH] mm/msync: return -ENOMEM if page-aligned length overflows Lorenzo Stoakes (ARM)
2026-11-20 11:06 ` David Hildenbrand (Arm)
2026-11-20 11:09 ` Vlastimil Babka (SUSE)
2026-11-20 11:15 ` Lorenzo Stoakes (ARM)
2026-11-21 0:53 ` mawupeng
2026-11-21 1:07 ` SJ Park
2026-11-24 0:56 ` + mm-msync-return-enomem-if-page-aligned-length-overflows.patch added to mm-hotfixes-unstable branch Andrew Morton
2026-11-24 13:13 ` [PATCH] mm/msync: return -ENOMEM if page-aligned length overflows Pedro Falcato
2026-12-02 3:47 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261202034751.F1F311F000C1@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=dingf3ng@gmail.com \
--cc=jannh@google.com \
--cc=liam@infradead.org \
--cc=ljs@kernel.org \
--cc=mawupeng1@huawei.com \
--cc=mm-commits@vger.kernel.org \
--cc=pfalcato@suse.de \
--cc=shakeel.butt@linux.dev \
--cc=sj@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.