5.5medium
tracing: Fix WARN_ON in tracing_buffers_mmap_close
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.13% (higher than 2% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: tracing: Fix WARN_ON in tracing_buffers_mmap_close When a process forks, the child process copies the parent's VMAs but the user_mapped reference count is not incremented. As a result, when both the parent and child processes exit, tracing_buffers_mmap_close() is called twice. On the second call, user_mapped is already 0, causing the function to return -ENODEV and triggering a WARN_ON. Normally, this isn't an issue as the memory is mapped with VM_DONTCOPY set. But this is only a hint, and the application can call madvise(MADVISE_DOFORK) which resets the VM_DONTCOPY flag. When the application does that, it can trigger this issue on fork. Fix it by incrementing the user_mapped reference count without re-mapping the pages in the VMA's open callback.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from cf9f0f7c4c5bb45e7bb270e48bab6f7837825a64 before 91f3e8d84c89918769e71393f839c9fefadc2580, from cf9f0f7c4c5bb45e7bb270e48bab6f7837825a64 before cdd96641b64297a2db42676f051362b76280a58b, from cf9f0f7c4c5bb45e7bb270e48bab6f7837825a64 before b0f269ba6fefe9e3cb9feedcf78fcd0b633800c0, from cf9f0f7c4c5bb45e7bb270e48bab6f7837825a64 before e39bb9e02b68942f8e9359d2a3efe7d37ae6be0e, 6.10 Not affected: before 6.10, from 6.12.77 up to 6.12.*, from 6.18.17 up to 6.18.*, from 6.19.7 up to 6.19.*, from 7.0 up to * | CVE List |
| linux linux_kernel | from 6.10.1 before 6.12.77, from 6.13 before 6.18.17, from 6.19 before 6.19.7, 6.10, 7.0 | NVD |
Classification
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: tracing: Fix WARN_ON in tracing_buffers_mmap_close When a process forks, the child process copies the parent's VMAs but the user_mapped reference count is not incremented. As a result, when both the parent and child processes exit, tracing_buffers_mmap_close() is called twice. On the second call, user_mapped is already 0, causing the function to return -ENODEV and triggering a WARN_ON. Normally, this isn't an issue as the memory is mapped with VM_DONTCOPY set. But this is only a hint, and the application can call madvise(MADVISE_DOFORK) which resets the VM_DONTCOPY flag. When the application does that, it can trigger this issue on fork. Fix it by incrementing the user_mapped reference count without re-mapping the pages in the VMA's open callback.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: tracing: Corrección de WARN_ON en tracing_buffers_mmap_close Cuando un proceso hace fork, el proceso hijo copia los VMAs del padre pero el contador de referencias user_mapped no se incrementa. Como resultado, cuando tanto el proceso padre como el hijo terminan, tracing_buffers_mmap_close() se llama dos veces. En la segunda llamada, user_mapped ya es 0, lo que hace que la función devuelva -ENODEV y active un WARN_ON. Normalmente, esto no es un problema ya que la memoria está mapeada con VM_DONTCOPY establecido. Pero esto es solo una sugerencia, y la aplicación puede llamar a madvise(MADVISE_DOFORK) lo que restablece el flag VM_DONTCOPY. Cuando la aplicación hace eso, puede activar este problema al hacer fork. Se soluciona incrementando el contador de referencias user_mapped sin remapear las páginas en la función de callback 'open' del VMA.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-23380 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2026-23380 changed 2026-06-17 | Public domain |