Descrizione
In the Linux kernel, the following vulnerability has been resolved: ext4: don't set EXT4_GET_BLOCKS_CONVERT when splitting before submitting I/O When allocating blocks during within-EOF DIO and writeback with dioread_nolock enabled, EXT4_GET_BLOCKS_PRE_IO was set to split an existing large unwritten extent. However, EXT4_GET_BLOCKS_CONVERT was set when calling ext4_split_convert_extents(), which may potentially result in stale data issues. Assume we have an unwritten extent, and then DIO writes the second half. [UUUUUUUUUUUUUUUU] on-disk extent U: unwritten extent [UUUUUUUUUUUUUUUU] extent status tree |<- ->| ----> dio write this range First, ext4_iomap_alloc() call ext4_map_blocks() with EXT4_GET_BLOCKS_PRE_IO, EXT4_GET_BLOCKS_UNWRIT_EXT and EXT4_GET_BLOCKS_CREATE flags set. ext4_map_blocks() find this extent and call ext4_split_convert_extents() with EXT4_GET_BLOCKS_CONVERT and the above flags set. Then, ext4_split_convert_extents() calls ext4_split_extent() with EXT4_EXT_MAY_ZEROOUT, EXT4_EXT_MARK_UNWRIT2 and EXT4_EXT_DATA_VALID2 flags set, and it calls ext4_split_extent_at() to split the second half with EXT4_EXT_DATA_VALID2, EXT4_EXT_MARK_UNWRIT1, EXT4_EXT_MAY_ZEROOUT and EXT4_EXT_MARK_UNWRIT2 flags set. However, ext4_split_extent_at() failed to insert extent since a temporary lack -ENOSPC. It zeroes out the first half but convert the entire on-disk extent to written since the EXT4_EXT_DATA_VALID2 flag set, but left the second half as unwritten in the extent status tree. [0000000000SSSSSS] data S: stale data, 0: zeroed [WWWWWWWWWWWWWWWW] on-disk extent W: written extent [WWWWWWWWWWUUUUUU] extent status tree Finally, if the DIO failed to write data to the disk, the stale data in the second half will be exposed once the cached extent entry is gone. Fix this issue by not passing EXT4_GET_BLOCKS_CONVERT when splitting an unwritten extent before submitting I/O, and make ext4_split_convert_extents() to zero out the entire extent range to zero for this case, and also mark the extent in the extent status tree for consistency.
Come correggere
Priorità: Bassa — correggere con la manutenzione ordinaria. Motivazione: CVSS 5.5.
Versioni da aggiornare
- Linux Linux Kernel: vulnerabili le versioni dalla
3.15precedenti alla5.10.253→ aggiornare alla5.10.253o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
5.11precedenti alla5.15.203→ aggiornare alla5.15.203o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
5.16precedenti alla6.6.130→ aggiornare alla6.6.130o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.7precedenti alla6.12.77→ aggiornare alla6.12.77o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.13precedenti alla6.18.17→ aggiornare alla6.18.17o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.19precedenti alla6.19.4→ aggiornare alla6.19.4o successiva.
Patch e advisory
- Patch: git.kernel.org/stable/c/2698731d25823267c29190cb578…
- Patch: git.kernel.org/stable/c/2920ec61c98b9476781359f05b9…
- Patch: git.kernel.org/stable/c/37555690f39f78ef69af347d9af…
- Patch: git.kernel.org/stable/c/67cdb7bd7442bd3cdc6d6088bbb…
- Patch: git.kernel.org/stable/c/716e7439a5a9b18c3ff882c2f8c…
- Patch: git.kernel.org/stable/c/77e407967cd872cd75d7e4a6919…
- Patch: git.kernel.org/stable/c/feaf2a80e78f89ee8a346412607…
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Ridurre l'esposizione del componente vulnerabile (segmentazione, accesso solo da reti fidate) finché la patch non è applicata.
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 | ≥ 3.15 < 5.10.253 | 5.10.253 |
| Linux | Linux Kernel | ≥ 5.11 < 5.15.203 | 5.15.203 |
| Linux | Linux Kernel | ≥ 5.16 < 6.6.130 | 6.6.130 |
| Linux | Linux Kernel | ≥ 6.7 < 6.12.77 | 6.12.77 |
| Linux | Linux Kernel | ≥ 6.13 < 6.18.17 | 6.18.17 |
| Linux | Linux Kernel | ≥ 6.19 < 6.19.4 | 6.19.4 |
Riferimenti
- Patchhttps://git.kernel.org/stable/c/2698731d25823267c29190cb578da9296a0c0d7b
- Patchhttps://git.kernel.org/stable/c/2920ec61c98b9476781359f05b94da84e80f54d4
- Patchhttps://git.kernel.org/stable/c/37555690f39f78ef69af347d9aff897e07445949
- Patchhttps://git.kernel.org/stable/c/67cdb7bd7442bd3cdc6d6088bbb2df9be2fe936c
- Patchhttps://git.kernel.org/stable/c/716e7439a5a9b18c3ff882c2f8c834b9ced1aaec
- Patchhttps://git.kernel.org/stable/c/77e407967cd872cd75d7e4a691908e49c8e6b4d4
- Patchhttps://git.kernel.org/stable/c/feaf2a80e78f89ee8a3464126077ba8683b62791
- Riferimentohttps://git.kernel.org/stable/c/6d8fa684b42724d74a77f980f5ee47cfd1ec7e74