CVE-2025-38447 (GCVE-0-2025-38447)

Vulnerability from cvelistv5 – Published: 2025-07-25 15:27 – Updated: 2026-08-05 12:01
VLAI
Title
mm/rmap: fix potential out-of-bounds page table access during batched unmap
Summary
In the Linux kernel, the following vulnerability has been resolved: mm/rmap: fix potential out-of-bounds page table access during batched unmap As pointed out by David[1], the batched unmap logic in try_to_unmap_one() may read past the end of a PTE table when a large folio's PTE mappings are not fully contained within a single page table. While this scenario might be rare, an issue triggerable from userspace must be fixed regardless of its likelihood. This patch fixes the out-of-bounds access by refactoring the logic into a new helper, folio_unmap_pte_batch(). The new helper correctly calculates the safe batch size by capping the scan at both the VMA and PMD boundaries. To simplify the code, it also supports partial batching (i.e., any number of pages from 1 up to the calculated safe maximum), as there is no strong reason to special-case for fully mapped folios.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: 354dffd29575cdf13154e8fb787322354aa9efc4 , < 510fe9c15d07e765d96be9a9dc37e5057c6c09f4 (git)
Affected: 354dffd29575cdf13154e8fb787322354aa9efc4 , < ddd05742b45b083975a0855ef6ebbf88cf1f532a (git)
Create a notification for this product.
Linux Linux Affected: 6.15
Unaffected: 0 , < 6.15 (semver)
Unaffected: 6.15.7 , ≤ 6.15.* (semver)
Unaffected: 6.16 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "mm/rmap.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "510fe9c15d07e765d96be9a9dc37e5057c6c09f4",
              "status": "affected",
              "version": "354dffd29575cdf13154e8fb787322354aa9efc4",
              "versionType": "git"
            },
            {
              "lessThan": "ddd05742b45b083975a0855ef6ebbf88cf1f532a",
              "status": "affected",
              "version": "354dffd29575cdf13154e8fb787322354aa9efc4",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "mm/rmap.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.15"
            },
            {
              "lessThan": "6.15",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.15.*",
              "status": "unaffected",
              "version": "6.15.7",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.16",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15.7",
                  "versionStartIncluding": "6.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.16",
                  "versionStartIncluding": "6.15",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm/rmap: fix potential out-of-bounds page table access during batched unmap\n\nAs pointed out by David[1], the batched unmap logic in\ntry_to_unmap_one() may read past the end of a PTE table when a large\nfolio\u0027s PTE mappings are not fully contained within a single page\ntable.\n\nWhile this scenario might be rare, an issue triggerable from userspace\nmust be fixed regardless of its likelihood.  This patch fixes the\nout-of-bounds access by refactoring the logic into a new helper,\nfolio_unmap_pte_batch().\n\nThe new helper correctly calculates the safe batch size by capping the\nscan at both the VMA and PMD boundaries.  To simplify the code, it also\nsupports partial batching (i.e., any number of pages from 1 up to the\ncalculated safe maximum), as there is no strong reason to special-case\nfor fully mapped folios."
        }
      ],
      "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 - The vulnerability is reached purely through local syscalls (mmap, madvise MADV_HUGEPAGE/MADV_FREE/MADV_PAGEOUT, mremap) against the attacker\u0027s own address space. There is no network- or adjacent-network-reachable path into the reclaim/rmap unmap code.\nAC:L - The attacker fully and deterministically controls every precondition \u2014 folio size, lazyfree state, PMD-straddling placement via an unaligned mremap, and the reclaim trigger via MADV_PAGEOUT \u2014 with no race to win and no attacker-independent condition. The required config (CONFIG_TRANSPARENT_HUGEPAGE) is ubiquitous and MADV_HUGEPAGE covers the thp=madvise default.\nPR:L - Only an ordinary unprivileged local user account is needed; every step uses unrestricted memory-management syscalls on private anonymous memory with no capability check anywhere along the path.\nUI:N - The attacking process performs the entire sequence itself and drives reclaim of its own folio via madvise(MADV_PAGEOUT); no victim action or interaction is involved.\nS:U - The out-of-bounds page-table access and the resulting corruption occur within the kernel\u0027s own security authority, the same authority the attacker is escalating within. No VM, IOMMU, or sandbox boundary is crossed by the primary defect.\nC:H - The bug reads up to ~4 KB of kernel memory past the end of a page-table page \u2014 far beyond a \"few bytes\" \u2014 and the resulting page-table corruption plus folio refcount underflow yields a use-after-free that can be leveraged into arbitrary kernel memory disclosure.\nI:H - When the OOB scan matches, get_and_clear_full_ptes()/set_ptes() write PTE-sized values past the end of the page-table page, and folio_ref_sub()/folio_remove_rmap_ptes() underflow the refcount and mapcount of a still-mapped folio, giving page-table-level memory corruption and a UAF write primitive suitable for privilege escalation.\nA:H - The out-of-bounds read can fault on an unmapped adjacent page (memory holes, DEBUG_PAGEALLOC/page poisoning, KASAN) causing an oops, and the refcount underflow frees a folio that is still mapped, reliably producing a kernel panic or corruption-induced crash."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:01:58.222Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/510fe9c15d07e765d96be9a9dc37e5057c6c09f4"
        },
        {
          "url": "https://git.kernel.org/stable/c/ddd05742b45b083975a0855ef6ebbf88cf1f532a"
        }
      ],
      "title": "mm/rmap: fix potential out-of-bounds page table access during batched unmap",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-38447",
    "datePublished": "2025-07-25T15:27:29.360Z",
    "dateReserved": "2025-04-16T04:51:24.018Z",
    "dateUpdated": "2026-08-05T12:01:58.222Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-38447",
      "date": "2026-08-05",
      "epss": "0.0016",
      "percentile": "0.05668"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-38447\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-07-25T16:15:30.210\",\"lastModified\":\"2026-07-30T06:23:14.803\",\"vulnStatus\":\"Modified\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nmm/rmap: fix potential out-of-bounds page table access during batched unmap\\n\\nAs pointed out by David[1], the batched unmap logic in\\ntry_to_unmap_one() may read past the end of a PTE table when a large\\nfolio\u0027s PTE mappings are not fully contained within a single page\\ntable.\\n\\nWhile this scenario might be rare, an issue triggerable from userspace\\nmust be fixed regardless of its likelihood.  This patch fixes the\\nout-of-bounds access by refactoring the logic into a new helper,\\nfolio_unmap_pte_batch().\\n\\nThe new helper correctly calculates the safe batch size by capping the\\nscan at both the VMA and PMD boundaries.  To simplify the code, it also\\nsupports partial batching (i.e., any number of pages from 1 up to the\\ncalculated safe maximum), as there is no strong reason to special-case\\nfor fully mapped folios.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: mm/rmap: corrige el posible acceso fuera de los l\u00edmites de la tabla de p\u00e1ginas durante la desasignaci\u00f3n por lotes Como se\u00f1al\u00f3 David[1], la l\u00f3gica de desasignaci\u00f3n por lotes en try_to_unmap_one() puede leer m\u00e1s all\u00e1 del final de una tabla PTE cuando las asignaciones PTE de un folio grande no est\u00e1n completamente contenidas dentro de una sola tabla de p\u00e1ginas. Si bien este escenario puede ser poco com\u00fan, un problema desencadenable desde el espacio de usuario debe corregirse independientemente de su probabilidad. Este parche corrige el acceso fuera de los l\u00edmites refactorizando la l\u00f3gica en un nuevo ayudante, folio_unmap_pte_batch(). El nuevo ayudante calcula correctamente el tama\u00f1o de lote seguro al limitar el escaneo en los l\u00edmites de VMA y PMD. Para simplificar el c\u00f3digo, tambi\u00e9n admite el procesamiento por lotes parcial (es decir, cualquier n\u00famero de p\u00e1ginas desde 1 hasta el m\u00e1ximo seguro calculado), ya que no hay una raz\u00f3n s\u00f3lida para un caso especial de folios completamente mapeados.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"mm/rmap.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"354dffd29575cdf13154e8fb787322354aa9efc4\",\"lessThan\":\"510fe9c15d07e765d96be9a9dc37e5057c6c09f4\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"354dffd29575cdf13154e8fb787322354aa9efc4\",\"lessThan\":\"ddd05742b45b083975a0855ef6ebbf88cf1f532a\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"mm/rmap.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"6.15\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"6.15\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.15.7\",\"lessThanOrEqual\":\"6.15.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.16\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9},{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H\",\"baseScore\":7.1,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.2}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-125\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.15\",\"versionEndExcluding\":\"6.15.7\",\"matchCriteriaId\":\"FBA11932-25B2-4915-A601-431072CDC904\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.16:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"6D4894DB-CCFE-4602-B1BF-3960B2E19A01\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.16:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"09709862-E348-4378-8632-5A7813EDDC86\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.16:rc3:*:*:*:*:*:*\",\"matchCriteriaId\":\"415BF58A-8197-43F5-B3D7-D1D63057A26E\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.16:rc4:*:*:*:*:*:*\",\"matchCriteriaId\":\"A0517869-312D-4429-80C2-561086E1421C\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.16:rc5:*:*:*:*:*:*\",\"matchCriteriaId\":\"85421F4E-C863-4ABF-B4B4-E887CC2F7F92\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/510fe9c15d07e765d96be9a9dc37e5057c6c09f4\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/ddd05742b45b083975a0855ef6ebbf88cf1f532a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}",
    "redhat_vex": {
      "aggregate_severity": "None",
      "current_release_date": "2026-06-30T10:33:11+00:00",
      "cve": "CVE-2025-38447",
      "id": "CVE-2025-38447",
      "initial_release_date": "2025-07-25T00:00:00+00:00",
      "product_status:known_not_affected": "274",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: mm/rmap: fix potential out-of-bounds page table access during batched unmap",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-38447.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-07-25T00:46:12Z",
      "cve": "CVE-2025-38447",
      "id": "CVE-2025-38447",
      "initial_release_date": "2025-07-29T23:23:26Z",
      "product_status:known_not_affected": "416",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2025-38447",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2025-38447.json",
      "version": "5"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

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.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…