CVE-2025-38564

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-38564
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38564.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-38564
Downstream
Published
2025-08-19T17:02:40.942Z
Modified
2025-12-02T16:33:43.688016Z
Summary
perf/core: Handle buffer mapping fail correctly in perf_mmap()
Details

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 perfmmap() 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 perfmmap_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::eventmapped() invocation before the maprange() call so that on maprange() failure perfmmapclose() can be invoked without causing an unbalanced event::eventunmapped() call.

perfmmapclose() undoes the reference counts and eventually frees buffers.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38564.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
b709eb872e19a19607bbb6d2975bc264d59735cf
Fixed
831e1c90a5d72e6977a57c44f47c46b73a438695
Fixed
a9025f73c88d9d6e125743a43afc569da3ce5328
Fixed
f74b9f4ba63ffdf597aaaa6cad7e284cb8e04820

Affected versions

v6.*

v6.13
v6.13-rc2
v6.13-rc3
v6.13-rc4
v6.13-rc5
v6.13-rc6
v6.13-rc7
v6.14
v6.14-rc1
v6.14-rc2
v6.14-rc3
v6.14-rc4
v6.14-rc5
v6.14-rc6
v6.14-rc7
v6.15
v6.15-rc1
v6.15-rc2
v6.15-rc3
v6.15-rc4
v6.15-rc5
v6.15-rc6
v6.15-rc7
v6.15.1
v6.15.2
v6.15.3
v6.15.4
v6.15.5
v6.15.6
v6.15.7
v6.15.8
v6.15.9
v6.16
v6.16-rc1
v6.16-rc2
v6.16-rc3
v6.16-rc4
v6.16-rc5
v6.16-rc6
v6.16-rc7

Database specific

source

"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38564.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.14.0
Fixed
6.15.10
Type
ECOSYSTEM
Events
Introduced
6.16.0
Fixed
6.16.1

Database specific

source

"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38564.json"