{"api_version":"1","generated_at":"2026-11-30T18:56:02+00:00","cve":"CVE-2026-139786","urls":{"html":"https://cve.report/CVE-2026-139786","api":"https://cve.report/api/cve/CVE-2026-139786.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-139786","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-139786"},"summary":{"title":"mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows","description":"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.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:20:12","updated_at":"2026-11-30 14:20:12"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/7135a05838e85845e1bbf6caa6596a7e3b791a40","name":"https://git.kernel.org/stable/c/7135a05838e85845e1bbf6caa6596a7e3b791a40","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/59381aea52a464e882eb85a61728dc147c1b8b50","name":"https://git.kernel.org/stable/c/59381aea52a464e882eb85a61728dc147c1b8b50","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/068a80b062757b208fa8af13554bd07608848203","name":"https://git.kernel.org/stable/c/068a80b062757b208fa8af13554bd07608848203","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/23f50b2fbf48f18fd1a6f2195a33c354619dedab","name":"https://git.kernel.org/stable/c/23f50b2fbf48f18fd1a6f2195a33c354619dedab","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/1a0b5660087189a322dd3b8f548701b887809d72","name":"https://git.kernel.org/stable/c/1a0b5660087189a322dd3b8f548701b887809d72","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-139786","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139786","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5e31275cc997f8ec5d9e8d65fe9840ebed89db19 23f50b2fbf48f18fd1a6f2195a33c354619dedab git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5e31275cc997f8ec5d9e8d65fe9840ebed89db19 068a80b062757b208fa8af13554bd07608848203 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5e31275cc997f8ec5d9e8d65fe9840ebed89db19 59381aea52a464e882eb85a61728dc147c1b8b50 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5e31275cc997f8ec5d9e8d65fe9840ebed89db19 1a0b5660087189a322dd3b8f548701b887809d72 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5e31275cc997f8ec5d9e8d65fe9840ebed89db19 7135a05838e85845e1bbf6caa6596a7e3b791a40 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.4","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.4 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.163 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.119 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.65 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.6 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","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"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"23f50b2fbf48f18fd1a6f2195a33c354619dedab","status":"affected","version":"5e31275cc997f8ec5d9e8d65fe9840ebed89db19","versionType":"git"},{"lessThan":"068a80b062757b208fa8af13554bd07608848203","status":"affected","version":"5e31275cc997f8ec5d9e8d65fe9840ebed89db19","versionType":"git"},{"lessThan":"59381aea52a464e882eb85a61728dc147c1b8b50","status":"affected","version":"5e31275cc997f8ec5d9e8d65fe9840ebed89db19","versionType":"git"},{"lessThan":"1a0b5660087189a322dd3b8f548701b887809d72","status":"affected","version":"5e31275cc997f8ec5d9e8d65fe9840ebed89db19","versionType":"git"},{"lessThan":"7135a05838e85845e1bbf6caa6596a7e3b791a40","status":"affected","version":"5e31275cc997f8ec5d9e8d65fe9840ebed89db19","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","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"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"6.4"},{"lessThan":"6.4","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.163","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.119","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.65","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.6","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.163","versionStartIncluding":"6.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.119","versionStartIncluding":"6.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.65","versionStartIncluding":"6.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.6","versionStartIncluding":"6.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"6.4","vulnerable":true}],"negate":false,"operator":"OR"}]}],"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."}],"providerMetadata":{"dateUpdated":"2026-11-30T13:37:59.413Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"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"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-139786","datePublished":"2026-11-30T13:37:59.413Z","dateReserved":"2026-11-30T13:22:15.953Z","dateUpdated":"2026-11-30T13:37:59.413Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:20:12","lastModifiedDate":"2026-11-30 14:20:12","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"139786","Ordinal":"1","Title":"mm/vma: avoid spurious write locks when mm->mm_lock_seq overflow","CVE":"CVE-2026-139786","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"139786","Ordinal":"1","NoteData":"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.","Type":"Description","Title":"mm/vma: avoid spurious write locks when mm->mm_lock_seq overflow"}]}}}