CVE-2026-139657 (GCVE-0-2026-139657)

Vulnerability from cvelistv5 – Published: 2026-11-30 13:36 – Updated: 2026-12-01 05:43
VLAI
Title
mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()
Summary
In the Linux kernel, the following vulnerability has been resolved: mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked() The !CONFIG_MMU implementation of __get_user_pages_locked() takes a bare get_page() reference for each page regardless of foll_flags: if (pages[i]) get_page(pages[i]); This is reached from pin_user_pages*() with FOLL_PIN set. unpin_user_page() is shared between MMU and NOMMU configurations and unconditionally calls gup_put_folio(..., FOLL_PIN), which subtracts GUP_PIN_COUNTING_BIAS (1024) from the folio refcount. This means that pin adds 1, and then unpin will subtract 1024. If a user maps a page (refcount 1), registers it 1023 times as an io_uring fixed buffer (1023 pin_user_pages calls -> refcount 1024), then unregisters: the first unpin_user_page subtracts 1024, refcount hits 0, the page is freed and returned to the buddy allocator. The remaining 1022 unpins write into whatever was reallocated, and the user's VMA still maps the freed page (NOMMU has no MMU to invalidate it). Reallocating the page for an io_uring pbuf_ring then lets userspace corrupt the new owner's data through the stale mapping. Use try_grab_folio() which adds GUP_PIN_COUNTING_BIAS for FOLL_PIN and 1 for FOLL_GET, mirroring the CONFIG_MMU path so pin and unpin are symmetric. Keep supporting the traditional behavior where users specify a pages array but don't set FOLL_GET. While at it, don't return NULL pointers in the page array, as this is really not expected for GUP users; instead, just fail and return -EFAULT. [ david: support traditional behavior with no FOLL_GET, extend description ]
Assigner
Linux CNA under the mitre root
CNA scorecard D 52/100 over 8585 records in the last 180 days details
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 3faa52c03f440d1b9ddef18c4f189f4790d52d7e , < d557cd126601a73a8756b0b18e1aadfb702df67b (git)
Affected: 3faa52c03f440d1b9ddef18c4f189f4790d52d7e , < 47f5b21856845382e6e0f4b74e6f93165e1f49bc (git)
Affected: 3faa52c03f440d1b9ddef18c4f189f4790d52d7e , < 4dc46f3c9a44bd1a6ab41d7626abb0992283afb4 (git)
Affected: 3faa52c03f440d1b9ddef18c4f189f4790d52d7e , < da01399b90a73cd00b502f7903fa5acbfac4a103 (git)
guessed Create a notification for this product.
Linux Linux Affected: 5.7
Unaffected: 0 , < 5.7 (semver)
Unaffected: 6.12.120 , ≤ 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": [
            "mm/gup.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "d557cd126601a73a8756b0b18e1aadfb702df67b",
              "status": "affected",
              "version": "3faa52c03f440d1b9ddef18c4f189f4790d52d7e",
              "versionType": "git"
            },
            {
              "lessThan": "47f5b21856845382e6e0f4b74e6f93165e1f49bc",
              "status": "affected",
              "version": "3faa52c03f440d1b9ddef18c4f189f4790d52d7e",
              "versionType": "git"
            },
            {
              "lessThan": "4dc46f3c9a44bd1a6ab41d7626abb0992283afb4",
              "status": "affected",
              "version": "3faa52c03f440d1b9ddef18c4f189f4790d52d7e",
              "versionType": "git"
            },
            {
              "lessThan": "da01399b90a73cd00b502f7903fa5acbfac4a103",
              "status": "affected",
              "version": "3faa52c03f440d1b9ddef18c4f189f4790d52d7e",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "mm/gup.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.7"
            },
            {
              "lessThan": "5.7",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.120",
              "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.12.120",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18.65",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "7.3.6",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "7.4-rc1",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()\n\nThe !CONFIG_MMU implementation of __get_user_pages_locked() takes a bare\nget_page() reference for each page regardless of foll_flags:\n\tif (pages[i])\n\t\tget_page(pages[i]);\n\nThis is reached from pin_user_pages*() with FOLL_PIN set.\nunpin_user_page() is shared between MMU and NOMMU configurations and\nunconditionally calls gup_put_folio(..., FOLL_PIN), which subtracts\nGUP_PIN_COUNTING_BIAS (1024) from the folio refcount.\n\nThis means that pin adds 1, and then unpin will subtract 1024.\n\nIf a user maps a page (refcount 1), registers it 1023 times as an\nio_uring fixed buffer (1023 pin_user_pages calls -\u003e refcount 1024), then\nunregisters: the first unpin_user_page subtracts 1024, refcount hits 0,\nthe page is freed and returned to the buddy allocator.  The remaining\n1022 unpins write into whatever was reallocated, and the user\u0027s VMA\nstill maps the freed page (NOMMU has no MMU to invalidate it).\nReallocating the page for an io_uring pbuf_ring then lets userspace\ncorrupt the new owner\u0027s data through the stale mapping.\n\nUse try_grab_folio() which adds GUP_PIN_COUNTING_BIAS for FOLL_PIN and 1\nfor FOLL_GET, mirroring the CONFIG_MMU path so pin and unpin are\nsymmetric. Keep supporting the traditional behavior where users specify\na pages array but don\u0027t set FOLL_GET.\n\nWhile at it, don\u0027t return NULL pointers in the page array,\nas this is really not expected for GUP users; instead, just fail and return\n-EFAULT.\n\n[ david: support traditional behavior with no FOLL_GET, extend\n  description ]"
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - Reached by io_uring_register(IORING_REGISTER_BUFFERS) \u2192 io_sqe_buffer_register() \u2192 io_pin_pages() \u2192 pin_user_pages_fast() \u2192 gup_fast_fallback() \u2192 __gup_longterm_locked() \u2192 the NOMMU __get_user_pages_locked() the fix patched. The pinned page and the iovecs are the caller\u0027s own memory, and no remote protocol supplies them.\nAC:L - On CONFIG_MMU=n (forced by CPU_V7M and RISCV_M_MODE), do_mmap_private() gives anonymous memory as order-0 alloc_pages_exact() pages with refcount 1. 1023 iovecs on one page raise it to 1024 (+1 each via get_page), and replacing one slot with IORING_REGISTER_BUFFERS_UPDATE unpins it by 1024 to zero. That is deterministic and fits the 8 MiB RLIMIT_MEMLOCK.\nPR:L - io_uring_setup()/io_uring_register() need no capability (io_uring_disabled defaults to 0). Without CAP_IPC_LOCK, io_buffer_account_pin() only charges 1023 order-0 pages against the user\u0027s RLIMIT_MEMLOCK, so any local unprivileged user qualifies.\nUI:N - The attacker maps, registers and replaces buffers in their own process. No other user mounts, opens or runs anything.\nS:U - The freed page comes back from the kernel\u0027s own buddy allocator and goes to kernel owners within the same authority. No hypervisor or IOMMU boundary is crossed.\nC:H - After the free, the other 1022 slots keep imu-\u003ebvec pointing at the page. IORING_OP_WRITE_FIXED via io_import_reg_buf() copies whatever kernel object reallocated it out to an attacker-readable file, an unbounded page-sized read.\nI:H - IORING_OP_READ_FIXED writes attacker file data into the reallocated page through those stale bvecs. Each remaining unpin_user_folio() subtracts 1024 from the new owner\u0027s refcount, and free_page_series() at munmap drops another ref. That lets the attacker free kernel-owned pages early, a page-level UAF write primitive.\nA:H - The refcount underflow on reallocated pages and the double free via free_page_series() corrupt buddy-allocator state and oops or panic the kernel. Even benign pinned I/O (io_uring fixed buffers, O_DIRECT bio_release_pages) drives the refcount negative and leaks the page permanently."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-12-01T05:43:02.584Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/d557cd126601a73a8756b0b18e1aadfb702df67b"
        },
        {
          "url": "https://git.kernel.org/stable/c/47f5b21856845382e6e0f4b74e6f93165e1f49bc"
        },
        {
          "url": "https://git.kernel.org/stable/c/4dc46f3c9a44bd1a6ab41d7626abb0992283afb4"
        },
        {
          "url": "https://git.kernel.org/stable/c/da01399b90a73cd00b502f7903fa5acbfac4a103"
        }
      ],
      "title": "mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2026-139657",
    "datePublished": "2026-11-30T13:36:46.794Z",
    "dateReserved": "2026-11-30T13:22:15.946Z",
    "dateUpdated": "2026-12-01T05:43:02.584Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2026-139657",
      "date": "2026-12-04",
      "epss": "0.00129",
      "percentile": "0.02723"
    },
    "microsoft_vex": {
      "current_release_date": "2026-12-02T01:16:56.000Z",
      "cve": "CVE-2026-139657",
      "id": "msrc_CVE-2026-139657",
      "initial_release_date": "2026-12-02T01:09:39.000Z",
      "product_status:known_affected": "1",
      "product_status:under_investigation": "1",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()",
      "url": "https://msrc.microsoft.com/csaf/vex/2026/msrc_cve-2026-139657.json",
      "version": "2"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "mm/gup.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "d557cd126601a73a8756b0b18e1aadfb702df67b",
                    "status": "affected",
                    "version": "3faa52c03f440d1b9ddef18c4f189f4790d52d7e",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "47f5b21856845382e6e0f4b74e6f93165e1f49bc",
                    "status": "affected",
                    "version": "3faa52c03f440d1b9ddef18c4f189f4790d52d7e",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "4dc46f3c9a44bd1a6ab41d7626abb0992283afb4",
                    "status": "affected",
                    "version": "3faa52c03f440d1b9ddef18c4f189f4790d52d7e",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "da01399b90a73cd00b502f7903fa5acbfac4a103",
                    "status": "affected",
                    "version": "3faa52c03f440d1b9ddef18c4f189f4790d52d7e",
                    "versionType": "git"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "mm/gup.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "5.7"
                  },
                  {
                    "lessThan": "5.7",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.12.*",
                    "status": "unaffected",
                    "version": "6.12.120",
                    "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/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()\n\nThe !CONFIG_MMU implementation of __get_user_pages_locked() takes a bare\nget_page() reference for each page regardless of foll_flags:\n\tif (pages[i])\n\t\tget_page(pages[i]);\n\nThis is reached from pin_user_pages*() with FOLL_PIN set.\nunpin_user_page() is shared between MMU and NOMMU configurations and\nunconditionally calls gup_put_folio(..., FOLL_PIN), which subtracts\nGUP_PIN_COUNTING_BIAS (1024) from the folio refcount.\n\nThis means that pin adds 1, and then unpin will subtract 1024.\n\nIf a user maps a page (refcount 1), registers it 1023 times as an\nio_uring fixed buffer (1023 pin_user_pages calls -\u003e refcount 1024), then\nunregisters: the first unpin_user_page subtracts 1024, refcount hits 0,\nthe page is freed and returned to the buddy allocator.  The remaining\n1022 unpins write into whatever was reallocated, and the user\u0027s VMA\nstill maps the freed page (NOMMU has no MMU to invalidate it).\nReallocating the page for an io_uring pbuf_ring then lets userspace\ncorrupt the new owner\u0027s data through the stale mapping.\n\nUse try_grab_folio() which adds GUP_PIN_COUNTING_BIAS for FOLL_PIN and 1\nfor FOLL_GET, mirroring the CONFIG_MMU path so pin and unpin are\nsymmetric. Keep supporting the traditional behavior where users specify\na pages array but don\u0027t set FOLL_GET.\n\nWhile at it, don\u0027t return NULL pointers in the page array,\nas this is really not expected for GUP users; instead, just fail and return\n-EFAULT.\n\n[ david: support traditional behavior with no FOLL_GET, extend\n  description ]"
          }
        ],
        "id": "CVE-2026-139657",
        "lastModified": "2026-12-01T06:17:47.293",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 5.9,
              "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
              "type": "Secondary"
            }
          ]
        },
        "published": "2026-11-30T14:19:49.613",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/47f5b21856845382e6e0f4b74e6f93165e1f49bc"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/4dc46f3c9a44bd1a6ab41d7626abb0992283afb4"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/d557cd126601a73a8756b0b18e1aadfb702df67b"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/da01399b90a73cd00b502f7903fa5acbfac4a103"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Received"
      }
    },
    "redhat_vex": {
      "aggregate_severity": "Moderate",
      "current_release_date": "2026-12-01T08:33:47+00:00",
      "cve": "CVE-2026-139657",
      "id": "CVE-2026-139657",
      "initial_release_date": "2026-11-30T13:36:46.794000+00:00",
      "product_status:known_affected": "238",
      "product_status:known_not_affected": "42",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: kernel: memory corruption via page reference count mismatch in NOMMU",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-139657.json",
      "version": "3"
    }
  }
}



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.