Descrizione
In the Linux kernel, the following vulnerability has been resolved: mm/damon/sysfs-schemes: protect memcg_path kfree() with damon_sysfs_lock Patch series "mm/damon/sysfs-schemes: fix use-after-free for [memcg_]path". Reads of 'memcg_path' and 'path' files in DAMON sysfs interface could race with their writes, results in use-after-free. Fix those. This patch (of 2): damon_sysfs_scheme_filter->mmecg_path can be read and written by users, via DAMON sysfs memcg_path file. It can also be indirectly read, for the parameters {on,off}line committing to DAMON. The reads for parameters committing are protected by damon_sysfs_lock to avoid the sysfs files being destroyed while any of the parameters are being read. But the user-driven direct reads and writes are not protected by any lock, while the write is deallocating the memcg_path-pointing buffer. As a result, the readers could read the already freed buffer (user-after-free). Note that the user-reads don't race when the same open file is used by the writer, due to kernfs's open file locking. Nonetheless, doing the reads and writes with separate open files would be common. Fix it by protecting both the user-direct reads and writes with damon_sysfs_lock.
Come correggere
Priorità: Media — correggere nel prossimo ciclo di patch. Motivazione: CVSS 7.8.
Versioni da aggiornare
- Linux Linux Kernel: vulnerabili le versioni dalla
6.6.96precedenti alla6.6.140→ aggiornare alla6.6.140o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.12.36precedenti alla6.12.88→ aggiornare alla6.12.88o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.15.5precedenti alla6.16→ aggiornare alla6.16o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.16.1precedenti alla6.18.30→ aggiornare alla6.18.30o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.19precedenti alla7.0.7→ aggiornare alla7.0.7o successiva. - Linux Linux Kernel: vulnerabile la versione
6.16→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
6.16 rc4→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
6.16 rc5→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
6.16 rc6→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
6.16 rc7→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
7.1 rc1→ installare l'ultima release supportata dal vendor.
Patch e advisory
- Patch: git.kernel.org/stable/c/1e68eb96e8beb1abefd12dd22c5…
- Patch: git.kernel.org/stable/c/b1e9f2d5870776347edef927f9b…
- Patch: git.kernel.org/stable/c/baecc45ad60e621ef14d6c1e7f4…
- Patch: git.kernel.org/stable/c/c88802d0e8edd14b6cd2daf3000…
- Patch: git.kernel.org/stable/c/eafd6f5372d29b0dd213799b92c…
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Ridurre la superficie esposta (disattivare servizi e funzionalità inutilizzati), mantenere attive le protezioni del sistema operativo (ASLR, DEP/NX) e segmentare la rete.
Verifica
- Individuare tutti gli asset con il prodotto interessato (inventario, scanner di vulnerabilità, CMDB).
- Confrontare la versione installata con quelle indicate sopra.
- Applicare l'aggiornamento in un ambiente di test, poi in produzione; riavviare i servizi se richiesto.
- Ripetere la scansione per confermare la correzione.
Configurazioni interessate
| Vendor | Prodotto | Versioni vulnerabili | Corretta in |
|---|---|---|---|
| Linux | Linux Kernel | ≥ 6.6.96 < 6.6.140 | 6.6.140 |
| Linux | Linux Kernel | ≥ 6.12.36 < 6.12.88 | 6.12.88 |
| Linux | Linux Kernel | ≥ 6.15.5 < 6.16 | 6.16 |
| Linux | Linux Kernel | ≥ 6.16.1 < 6.18.30 | 6.18.30 |
| Linux | Linux Kernel | ≥ 6.19 < 7.0.7 | 7.0.7 |
| Linux | Linux Kernel | 6.16 | — |
| Linux | Linux Kernel | 6.16 rc4 | — |
| Linux | Linux Kernel | 6.16 rc5 | — |
| Linux | Linux Kernel | 6.16 rc6 | — |
| Linux | Linux Kernel | 6.16 rc7 | — |
| Linux | Linux Kernel | 7.1 rc1 | — |
Riferimenti
- Patchhttps://git.kernel.org/stable/c/1e68eb96e8beb1abefd12dd22c5637795d8a877e
- Patchhttps://git.kernel.org/stable/c/b1e9f2d5870776347edef927f9bb3ea19b8e3abb
- Patchhttps://git.kernel.org/stable/c/baecc45ad60e621ef14d6c1e7f41ef36bbfdf910
- Patchhttps://git.kernel.org/stable/c/c88802d0e8edd14b6cd2daf3000f99adbc4c85c5
- Patchhttps://git.kernel.org/stable/c/eafd6f5372d29b0dd213799b92c2c9c7ad31d7da