CVE-2026-139786 (GCVE-0-2026-139786)

Vulnerability from cvelistv5 – Published: 2026-11-30 13:37 – Updated: 2026-11-30 13:37
VLAI
Title
mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows
Summary
In the Linux kernel, the following vulnerability has been resolved: mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows So far the assumption has been that mm->mm_lock_seq overflow is benign, resulting only in readers spuriously falling back to the mmap lock, however it turns out that this was an unsafe assumption. If a VMA can be spuriously considered write locked that means read lock exclusion does not take place, and thus a VMA can end up write-locked with concurrent readers. Since overflow only occurs every 2^31 write lock/unlock cycles, resolve the issue by resetting every VMA's vma->vm_lock_seq each time such an overflow occurs. This is done in vma_end_write_all(), which is called when the mmap write lock is released, i.e. in mmap_write_unlock() and mmap_write_downgrade(). Care must be taken, as resetting the sequence count at overflow means changing the seqcount of VMAs which are already attached and observable. The mm's seqcount is guaranteed to be odd when a write lock is held, and thus any write locked VMA will have an odd seqcount assigned. Therefore resetting to an even value prevents spurious write locks, since these can only occur with the mmap write lock held, at which point the mmap seqcount will be odd. However, vma_start_read() also checks vma->vm_lock_seq == mm->mm_lock_seq, bailing if so (indicating a write lock). This would cause any even reset value chosen to prevent VMA read locks from being taken - avoid this by also checking whether the VMA seqcount is odd before bailing on the read lock. So far, vma->vm_lock_seq has defaulted to UINT_MAX, but this has been unnecessary since commit e5e7fb278e59 ("mm: convert mm_lock_seq to a proper seqcount"), since this is assigned when the VMA is still detached, and cannot be observed. Therefore perform both reset and initialisation of vma->vm_lock_seq by simply setting vma->vm_lock_seq to zero. The reset, performed in __mm_reset_vma_seqcounts(), only needs to WRITE_ONCE() the value. However the read of vma->vm_lock_seq in vma_start_read() needs to have acquire semantics to pair with the smp_wmb() in do_raw_write_seqcount_end() so a reader reading a reset value also observes VMA modifications made under the write lock. Since all VMA write locks were just released and the mmap write lock is still held, there are no concurrent VMA writers. Concurrent VMA readers are unaffected. New VMA readers observe either zero, never a write lock, or the prior seqcount, behaving as before the reset. Since this only occurs every 2^31 write lock/unlock cycles, the time taken to update all VMAs is considered to be acceptable. Also update comments, documentation and VMA userland tests to reflect the change. User facing effects are - dangerous races that could cause memory corruption or NULL pointer derefences (especially on page table traversal) are avoided.
Severity
No CVSS data available.
Assigner
Linux CNA under the mitre root
CNA scorecard D 53/100 over 7121 records in the last 180 days details
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 5e31275cc997f8ec5d9e8d65fe9840ebed89db19 , < 23f50b2fbf48f18fd1a6f2195a33c354619dedab (git)
Affected: 5e31275cc997f8ec5d9e8d65fe9840ebed89db19 , < 068a80b062757b208fa8af13554bd07608848203 (git)
Affected: 5e31275cc997f8ec5d9e8d65fe9840ebed89db19 , < 59381aea52a464e882eb85a61728dc147c1b8b50 (git)
Affected: 5e31275cc997f8ec5d9e8d65fe9840ebed89db19 , < 1a0b5660087189a322dd3b8f548701b887809d72 (git)
Affected: 5e31275cc997f8ec5d9e8d65fe9840ebed89db19 , < 7135a05838e85845e1bbf6caa6596a7e3b791a40 (git)
guessed Create a notification for this product.
Linux Linux Affected: 6.4
Unaffected: 0 , < 6.4 (semver)
Unaffected: 6.6.163 , ≤ 6.6.* (semver)
Unaffected: 6.12.119 , ≤ 6.12.* (semver)
Unaffected: 6.18.65 , ≤ 6.18.* (semver)
Unaffected: 7.3.6 , ≤ 7.3.* (semver)
Unaffected: 7.4-rc1 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "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-\u003emm_lock_seq overflows\n\nSo far the assumption has been that mm-\u003emm_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\u0027s vma-\u003evm_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\u0027s 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-\u003evm_lock_seq == mm-\u003emm_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-\u003evm_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-\u003evm_lock_seq by\nsimply setting vma-\u003evm_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-\u003evm_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-\u003emm_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",
  "vulnerability-lookup:meta": {
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "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"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm/vma: avoid spurious write locks when mm-\u003emm_lock_seq overflows\n\nSo far the assumption has been that mm-\u003emm_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\u0027s vma-\u003evm_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\u0027s 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-\u003evm_lock_seq == mm-\u003emm_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-\u003evm_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-\u003evm_lock_seq by\nsimply setting vma-\u003evm_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-\u003evm_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."
          }
        ],
        "id": "CVE-2026-139786",
        "lastModified": "2026-11-30T14:20:12.090",
        "metrics": {},
        "published": "2026-11-30T14:20:12.090",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/068a80b062757b208fa8af13554bd07608848203"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/1a0b5660087189a322dd3b8f548701b887809d72"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/23f50b2fbf48f18fd1a6f2195a33c354619dedab"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/59381aea52a464e882eb85a61728dc147c1b8b50"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/7135a05838e85845e1bbf6caa6596a7e3b791a40"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Received"
      }
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.