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=1796150904; b=KmrG+ZuGEiRh4/MkDx8y0qCjDXSHAKhy3jPb2mQ1k1qDiiq6xX+k0Yu9E9O++Kdrg3xN 6XhOUcx/wPEKfaWKJHHR8fGN4dCAgkfY9xwNsJRZr5ebZVGeS9Tg1cxkOjeEWd5YAhRWO kL9T6RwHXsH+d9YbECl7FsF9wd4joa/DcSTRw3969MCNAzmDYsrfIvMr1iCrcikwrvVts Xf/eItM6C+2nkoPksm8fLq1fziXhuA3rBZcj2dzBuhuhwluvDjGBJyE7y9+krVrjwLRCA 1lDPwDkPEHsp31sdjhbEcIyfuMsoVdQ7YGpPW7lScz0Rqgb19NxTUGU45gjhAj6X1OQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796150904; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=ilW7F4SpxLLUAF2mh6SzGAnnTZvmTJM3GiUcofi8+L8=; b=5ivs/5ye0g/+GmkTGSnNXc2tt23zxQWwhgQLa1ekyVBTFsbyVCq8Sa2HGoyw7N8Fci3c P3FIGI33Vd3iGdBjBvcEUCF91uOeDuhujznes9JARdgqvbXX6qyQ/epeeeb0hY82OT7Tx RphywPqB+JYL7iECGi3Zwpae2mOjhons3kY+F38iYW0PvG1duStL3Mj4yZU79GzxIylTw cA/gf11VHjvWWMo+o9SnpVRVfwrqZoZjGJBSas+ZT3J2Drd033LYdxsN4PZnkuo1TZGzJ ruAg5WZGbKMj+XHIfZl2p8OzuxoGAb8anUKUzS2CbRIIrQJo2/1qEEjuYsUsZ1kX+Ow== 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=kFLf2RGI; 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 D7DF4606A31A for ; Tue, 1 Dec 2026 18:48:24 +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=kFLf2RGI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69CF81F00898; Tue, 1 Dec 2026 18:48:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796150904; bh=ilW7F4SpxLLUAF2mh6SzGAnnTZvmTJM3GiUcofi8+L8=; h=Date:To:From:In-Reply-To:References:Subject; b=kFLf2RGI8FAY2A90viv6pxw8YONJZJwmNyries1YoWcPULFOtIPOBYJW68JhTNsZq 90wHnePXstb/op6XRCIg/yD0Jje/o2T+7bb8Pjnd3hNhGzDjDvPXAtx+pnrU9Et/17 eB0nuXs7bvZF8GtH2UUyqpts3h3P8fr+OhQTJgiA= Date: Tue, 01 Dec 2026 10:48:24 -0800 To: mm-commits@vger.kernel.org,vbabka@kernel.org,usama.anjum@arm.com, surenb@google.com,skhan@linuxfoundation.org,sfr@canb.auug.org.au, rppt@kernel.org,rientjes@google.com,riel@redhat.com,rdunlap@infradead.org, pfalcato@suse.de,mirq-linux@rere.qmqm.pl,mhocko@suse.com,ljs@kernel.org, liam@infradead.org,jannh@google.com,jaharkes@cs.cmu.edu,hughd@google.com, hannes@cmpxchg.org,david@readahead.eu,david@kernel.org,corbet@lwn.net, avagin@gmail.com,arnd@arndb.de,alexs@kernel.org,mason@kernel.org, akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261127-mlock-madvise-mprotect-ai-fixes-v1-3-e46b2b1eb435@kernel.org> References: <20261127-mlock-madvise-mprotect-ai-fixes-v1-3-e46b2b1eb435@kernel.org> Subject: + mm-mprotect-fix-unpaired-notifier-start-at-address-0.patch added to mm-new branch Message-Id: <20261201184824.69CF81F00898@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: mm/mprotect: fix unpaired notifier start at address 0 has been added to the -mm mm-new branch. Its filename is mm-mprotect-fix-unpaired-notifier-start-at-address-0.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-mprotect-fix-unpaired-notifier-start-at-address-0.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next 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: Chris Mason Subject: mm/mprotect: fix unpaired notifier start at address 0 Date: Fri, 27 Nov 2026 19:45:42 +0000 A protection change on a VMA that starts at address 0 can leave an MMU notifier invalidation open forever. Waiters for its end, such as kvm_swap_active_memslots() and mmu_interval_read_begin(), then sleep uninterruptibly and never wake up. Fix by using a boolean value to track this instead of the start address of the range. [ljs@kernel.org: commit msg tweak] Link: https://patch.msgid.link/20261127-mlock-madvise-mprotect-ai-fixes-v1-3-e46b2b1eb435@kernel.org Fixes: a5338093bfb4 ("mm: move mmu notifier call from change_protection to change_pmd_range") Signed-off-by: Chris Mason Signed-off-by: Lorenzo Stoakes (ARM) Signed-off-by: Andrew Morton Reviewed-by: Pedro Falcato Reviewed-by: David Hildenbrand (Arm) Cc: Jan Harkes Cc: David Rheinsberg Cc: Hugh Dickins Cc: Vlastimil Babka Cc: Liam R. Howlett Cc: Jann Horn Cc: Alex Shi Cc: Johannes Weiner Cc: David Rientjes Cc: Rik van Riel Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Michal Hocko Cc: Jonathan Corbet Cc: Shuah Khan Cc: Randy Dunlap Cc: Michał Mirosław Cc: Arnd Bergmann Cc: Stephen Rothwell Cc: Muhammad Usama Anjum Cc: Andrei Vagin mm/mprotect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/mm/mprotect.c~mm-mprotect-fix-unpaired-notifier-start-at-address-0 +++ a/mm/mprotect.c @@ -553,8 +553,7 @@ static inline long change_pud_range(stru pud_t *pudp, pud; unsigned long next; long pages = 0, ret; - - range.start = 0; + bool notified = false; pudp = pud_offset(p4d, addr); do { @@ -570,7 +569,8 @@ again: if (pud_none(pud)) continue; - if (!range.start) { + if (!notified) { + notified = true; mmu_notifier_range_init(&range, MMU_NOTIFY_PROTECTION_VMA, 0, vma->vm_mm, addr, end); @@ -598,7 +598,7 @@ again: cp_flags); } while (pudp++, addr = next, addr != end); - if (range.start) + if (notified) mmu_notifier_invalidate_range_end(&range); return pages; _ 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 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 kfence-use-a-nofault-store-to-zero-the-guard-page.patch mm-hugetlb-fix-truncated-copy-result-in-uffdio_copy.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 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