Skip to content
Heist/ feed
Back to feed
UnratedFix available

perf/core: Handle buffer mapping fail correctly in perf_mmap()

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: perf/core: Handle buffer mapping fail correctly in perf_mmap() After successful allocation of a buffer or a successful attachment to an existing buffer perf_mmap() tries to map the buffer read only into the page table. If that fails, the already set up page table entries are zapped, but the other perf specific side effects of that failure are not handled. The calling code just cleans up the VMA and does not invoke perf_mmap_close(). This leaks reference counts, corrupts user->vm accounting and also results in an unbalanced invocation of event::event_mapped(). Cure this by moving the event::event_mapped() invocation before the map_range() call so that on map_range() failure perf_mmap_close() can be invoked without causing an unbalanced event::event_unmapped() call. perf_mmap_close() undoes the reference counts and eventually frees buffers.

Products
Kernel
Affected versions
Not specified
Fixed versions
6.15.10, 6.16.1
CVEs
CVE-2025-38564
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 03:14 UTC · Revision 1

Source evidence

perf/core: Handle buffer mapping fail correctly in perf_mmap()

core-osv · Original source

Published 19 Aug 2025, 17:02 UTC

In the Linux kernel, the following vulnerability has been resolved: perf/core: Handle buffer mapping fail correctly in perf_mmap() After successful allocation of a buffer or a successful attachment to an existing buffer perf_mmap() tries to map the buffer read only into the page table. If that fails, the already set up page table entries are zapped, but the other perf specific side effects of that failure are not handled. The calling code just cleans up the VMA and does not invoke perf_mmap_close(). This leaks reference counts, corrupts user->vm accounting and also results in an unbalanced invocation of event::event_mapped(). Cure this by moving the event::event_mapped() invocation before the map_range() call so that on map_range() failure perf_mmap_close() can be invoked without causing an unbalanced event::event_unmapped() call. perf_mmap_close() undoes the reference counts and eventually frees buffers.

osv:CVE-2025-38564

Kernel

Fixed versions: 6.15.10, 6.16.1

Complete source record
{
  "id": "63e9bfd25709610e5ff1dadb6892b5573be914e65f30110d419de7cf6e28195a",
  "url": "https://osv.dev/vulnerability/CVE-2025-38564",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "perf/core: Handle buffer mapping fail correctly in perf_mmap()",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: perf/core: Handle buffer mapping fail correctly in perf_mmap() After successful allocation of a buffer or a successful attachment to an existing buffer perf_mmap() tries to map the buffer read only into the page table. If that fails, the already set up page table entries are zapped, but the other perf specific side effects of that failure are not handled. The calling code just cleans up the VMA and does not invoke perf_mmap_close(). This leaks reference counts, corrupts user->vm accounting and also results in an unbalanced invocation of event::event_mapped(). Cure this by moving the event::event_mapped() invocation before the map_range() call so that on map_range() failure perf_mmap_close() can be invoked without causing an unbalanced event::event_unmapped() call. perf_mmap_close() undoes the reference counts and eventually frees buffers.",
    "evidence": "osv:CVE-2025-38564",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.15.10",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.16.1",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2025-38564",
      "aliases": [
        "CVE-2025-38564"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "b709eb872e19a19607bbb6d2975bc264d59735cf"
                },
                {
                  "fixed": "831e1c90a5d72e6977a57c44f47c46b73a438695"
                },
                {
                  "fixed": "a9025f73c88d9d6e125743a43afc569da3ce5328"
                },
                {
                  "fixed": "f74b9f4ba63ffdf597aaaa6cad7e284cb8e04820"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38564.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.14.0"
                },
                {
                  "fixed": "6.15.10"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.16.0"
                },
                {
                  "fixed": "6.16.1"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38564.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:42.208452142Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/831e1c90a5d72e6977a57c44f47c46b73a438695",
        "https://git.kernel.org/stable/c/a9025f73c88d9d6e125743a43afc569da3ce5328",
        "https://git.kernel.org/stable/c/f74b9f4ba63ffdf597aaaa6cad7e284cb8e04820",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38564.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-38564",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38564.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-38564",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 509745,
  "published_at": "2025-08-19T17:02:40.942+00:00"
}