CVE-2025-38563

In the Linux kernel, the following vulnerability has been resolved: perf/core: Prevent VMA split of buffer mappings The perf mmap code is careful about mmap()'ing the user page with the ringbuffer and additionally the auxiliary buffer, when the event supports it. Once the first mapping is established, subsequent mapping have to use the same offset and the same size in both cases. The reference counting for the ringbuffer and the auxiliary buffer depends on this being correct. Though perf does not prevent that a related mapping is split via mmap(2), munmap(2) or mremap(2). A split of a VMA results in perf_mmap_open() calls, which take reference counts, but then the subsequent perf_mmap_close() calls are not longer fulfilling the offset and size checks. This leads to reference count leaks. As perf already has the requirement for subsequent mappings to match the initial mapping, the obvious consequence is that VMA splits, caused by resizing of a mapping or partial unmapping, have to be prevented. Implement the vm_operations_struct::may_split() callback and return unconditionally -EINVAL. That ensures that the mapping offsets and sizes cannot be changed after the fact. Remapping to a different fixed address with the same size is still possible as it takes the references for the new mapping and drops those of the old mapping.
CVSS

No CVSS.

Configurations

No configuration.

History

20 Aug 2025, 14:40

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: perf/core: Prevenir la división de VMA de las asignaciones de búfer El código perf mmap es cuidadoso al realizar mmap() en la página de usuario con el búfer de anillo y, adicionalmente, el búfer auxiliar, cuando el evento lo admite. Una vez que se establece la primera asignación, las asignaciones posteriores deben usar el mismo desplazamiento y el mismo tamaño en ambos casos. El recuento de referencias para el búfer de anillo y el búfer auxiliar depende de que esto sea correcto. Aunque perf no impide que una asignación relacionada se divida mediante mmap(2), munmap(2) o mremap(2). Una división de una VMA da como resultado llamadas a perf_mmap_open(), que toman recuentos de referencias, pero luego las llamadas perf_mmap_close() posteriores ya no cumplen con las comprobaciones de desplazamiento y tamaño. Esto conduce a fugas de recuento de referencias. Como perf ya tiene el requisito de que las asignaciones posteriores coincidan con la asignación inicial, la consecuencia obvia es que se deben evitar las divisiones de VMA, causadas por el cambio de tamaño de una asignación o la desasignación parcial. Implemente la función de retorno vm_operations_struct::may_split() y devuelva incondicionalmente -EINVAL. Esto garantiza que los desplazamientos y tamaños de la asignación no se puedan modificar posteriormente. La reasignación a una dirección fija diferente con el mismo tamaño sigue siendo posible, ya que toma las referencias de la nueva asignación y descarta las de la asignación anterior.

19 Aug 2025, 17:15

Type Values Removed Values Added
New CVE

Information

Published : 2025-08-19 17:15

Updated : 2025-08-20 14:40


NVD link : CVE-2025-38563

Mitre link : CVE-2025-38563

CVE.ORG link : CVE-2025-38563


JSON object : View

Products Affected

No product.

CWE

No CWE.