{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139786","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-11-30T13:22:15.953Z","datePublished":"2026-11-30T13:37:59.413Z","dateUpdated":"2026-12-01T05:43:21.849Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-12-01T05:43:21.849Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/vma: avoid spurious write locks when mm->mm_lock_seq overflows\n\nSo far the assumption has been that mm->mm_lock_seq overflow is benign,\nresulting only in readers spuriously falling back to the mmap lock, however\nit turns out that this was an unsafe assumption.\n\nIf a VMA can be spuriously considered write locked that means read lock\nexclusion does not take place, and thus a VMA can end up write-locked with\nconcurrent readers.\n\nSince overflow only occurs every 2^31 write lock/unlock cycles, resolve the\nissue by resetting every VMA's vma->vm_lock_seq each time such an overflow\noccurs.\n\nThis is done in vma_end_write_all(), which is called when the mmap write\nlock is released, i.e. in mmap_write_unlock() and mmap_write_downgrade().\n\nCare must be taken, as resetting the sequence count at overflow means\nchanging the seqcount of VMAs which are already attached and observable.\n\nThe mm's seqcount is guaranteed to be odd when a write lock is held, and\nthus any write locked VMA will have an odd seqcount assigned.\n\nTherefore resetting to an even value prevents spurious write locks, since\nthese can only occur with the mmap write lock held, at which point the mmap\nseqcount will be odd.\n\nHowever, vma_start_read() also checks vma->vm_lock_seq == mm->mm_lock_seq,\nbailing if so (indicating a write lock).\n\nThis would cause any even reset value chosen to prevent VMA read locks from\nbeing taken - avoid this by also checking whether the VMA seqcount is odd\nbefore bailing on the read lock.\n\nSo far, vma->vm_lock_seq has defaulted to UINT_MAX, but this has been\nunnecessary since commit e5e7fb278e59 (\"mm: convert mm_lock_seq to a proper\nseqcount\"), since this is assigned when the VMA is still detached, and\ncannot be observed.\n\nTherefore perform both reset and initialisation of vma->vm_lock_seq by\nsimply setting vma->vm_lock_seq to zero.\n\nThe reset, performed in __mm_reset_vma_seqcounts(), only needs to\nWRITE_ONCE() the value.\n\nHowever the read of vma->vm_lock_seq in vma_start_read() needs to have\nacquire semantics to pair with the smp_wmb() in do_raw_write_seqcount_end()\nso a reader reading a reset value also observes VMA modifications made\nunder the write lock.\n\nSince all VMA write locks were just released and the mmap write lock is\nstill held, there are no concurrent VMA writers.\n\nConcurrent VMA readers are unaffected. New VMA readers observe either zero,\nnever a write lock, or the prior seqcount, behaving as before the reset.\n\nSince this only occurs every 2^31 write lock/unlock cycles, the time taken\nto update all VMAs is considered to be acceptable.\n\nAlso update comments, documentation and VMA userland tests to reflect the\nchange.\n\nUser facing effects are - dangerous races that could cause memory\ncorruption or NULL pointer derefences (especially on page table traversal)\nare avoided."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The wrap is driven by a local process cycling its own mmap write lock (e.g. munmap() of an empty range via __vm_munmap) until mm->mm_lock_seq matches a stale vma->vm_lock_seq. The race is then run from the same process with page faults or madvise() against its own address space. No remote protocol carries any input.\nAC:H - The attacker produces the wrap on demand: 2^31 empty munmap() cycles took ~10 minutes (268 ns each) and can be counted exactly in their own mm. Both sides of the race are the attacker's threads: a reader holding the VMA lock (fault or a long MADV_DONTNEED) and a writer (mremap/split/mprotect) issued at the counted cycle. Many prepared VMAs give many attempts per wrap.\nPR:L - munmap, mremap, mprotect, madvise(MADV_DONTNEED) and page faults on your own mappings need no capability, so any unprivileged local user who can run code can reach vma_start_write() and lock_vma_under_rcu().\nUI:N - The attacker performs every step (the counter wrap, the reader thread and the writer thread) on their own process's mappings. No other user or administrator action is involved.\nS:U - The corruption is in kernel memory-management state (page tables and VMA fields) of the same kernel, and gives kernel-level compromise within the same security authority. No hypervisor or IOMMU boundary is crossed.\nC:H - When __is_vma_write_locked() falsely returns true, vma_start_write() skips __vma_start_write() and existing readers are not drained. mremap's move_page_tables or a split/unmap then frees or moves page tables under a running fault or zap, giving page-table/page use-after-free and stale PTEs to freed physical pages, which allows arbitrary memory reads.\nI:H - The same page-table use-after-free, or a stale PTE that the fault path installs after mremap/munmap has torn the range down, gives write access to freed and reallocated physical pages. That is a known route to arbitrary kernel memory writes and privilege escalation.\nA:H - The commit names memory corruption and NULL pointer dereferences during page-table traversal, from walking freed or moved page tables under the unexcluded per-VMA read lock. These oops or corrupt the kernel, and the attacker can retry after every 2^31-cycle wrap."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["Documentation/mm/process_addrs.rst","include/linux/mm_types.h","include/linux/mmap_lock.h","mm/mmap_lock.c","tools/testing/vma/include/dup.h","tools/testing/vma/shared.c"],"versions":[{"version":"5e31275cc997f8ec5d9e8d65fe9840ebed89db19","lessThan":"23f50b2fbf48f18fd1a6f2195a33c354619dedab","status":"affected","versionType":"git"},{"version":"5e31275cc997f8ec5d9e8d65fe9840ebed89db19","lessThan":"068a80b062757b208fa8af13554bd07608848203","status":"affected","versionType":"git"},{"version":"5e31275cc997f8ec5d9e8d65fe9840ebed89db19","lessThan":"59381aea52a464e882eb85a61728dc147c1b8b50","status":"affected","versionType":"git"},{"version":"5e31275cc997f8ec5d9e8d65fe9840ebed89db19","lessThan":"1a0b5660087189a322dd3b8f548701b887809d72","status":"affected","versionType":"git"},{"version":"5e31275cc997f8ec5d9e8d65fe9840ebed89db19","lessThan":"7135a05838e85845e1bbf6caa6596a7e3b791a40","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["Documentation/mm/process_addrs.rst","include/linux/mm_types.h","include/linux/mmap_lock.h","mm/mmap_lock.c","tools/testing/vma/include/dup.h","tools/testing/vma/shared.c"],"versions":[{"version":"6.4","status":"affected"},{"version":"0","lessThan":"6.4","status":"unaffected","versionType":"semver"},{"version":"6.6.163","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.119","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.65","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.6","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/23f50b2fbf48f18fd1a6f2195a33c354619dedab"},{"url":"https://git.kernel.org/stable/c/068a80b062757b208fa8af13554bd07608848203"},{"url":"https://git.kernel.org/stable/c/59381aea52a464e882eb85a61728dc147c1b8b50"},{"url":"https://git.kernel.org/stable/c/1a0b5660087189a322dd3b8f548701b887809d72"},{"url":"https://git.kernel.org/stable/c/7135a05838e85845e1bbf6caa6596a7e3b791a40"}],"title":"mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows","x_generator":{"engine":"bippy-1.2.0"}}}}