CVE-2025-38564

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

State
Published
Severity
Not scored
Published
Aug 19, 2025
Updated
May 11, 2026
Reserved
Apr 16, 2025

Read the record on cve.org

Description

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.

Scores

The record has no CVSS score.

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • b709eb872e19a19607bbb6d2975bc264d59735cf to before 831e1c90a5d72e6977a57c44f47c46b73a438695Affected
  • b709eb872e19a19607bbb6d2975bc264d59735cf to before a9025f73c88d9d6e125743a43afc569da3ce5328Affected
  • b709eb872e19a19607bbb6d2975bc264d59735cf to before f74b9f4ba63ffdf597aaaa6cad7e284cb8e04820Affected
LinuxLinux
  • 6.14Affected
  • before 6.14Not affected
  • 6.15.10 through 6.15.*Not affected
  • 6.16.1 through 6.16.*Not affected
  • 6.17 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.