Descrizione
In the Linux kernel, the following vulnerability has been resolved: lib/crypto: mpi: Fix integer underflow in mpi_read_raw_from_sgl() Yiming reports an integer underflow in mpi_read_raw_from_sgl() when subtracting "lzeros" from the unsigned "nbytes". For this to happen, the scatterlist "sgl" needs to occupy more bytes than the "nbytes" parameter and the first "nbytes + 1" bytes of the scatterlist must be zero. Under these conditions, the while loop iterating over the scatterlist will count more zeroes than "nbytes", subtract the number of zeroes from "nbytes" and cause the underflow. When commit 2d4d1eea540b ("lib/mpi: Add mpi sgl helpers") originally introduced the bug, it couldn't be triggered because all callers of mpi_read_raw_from_sgl() passed a scatterlist whose length was equal to "nbytes". However since commit 63ba4d67594a ("KEYS: asymmetric: Use new crypto interface without scatterlists"), the underflow can now actually be triggered. When invoking a KEYCTL_PKEY_ENCRYPT system call with a larger "out_len" than "in_len" and filling the "in" buffer with zeroes, crypto_akcipher_sync_prep() will create an all-zero scatterlist used for both the "src" and "dst" member of struct akcipher_request and thereby fulfil the conditions to trigger the bug: sys_keyctl() keyctl_pkey_e_d_s() asymmetric_key_eds_op() software_key_eds_op() crypto_akcipher_sync_encrypt() crypto_akcipher_sync_prep() crypto_akcipher_encrypt() rsa_enc() mpi_read_raw_from_sgl() To the user this will be visible as a DoS as the kernel spins forever, causing soft lockup splats as a side effect. Fix it.
Come correggere
Priorità: Bassa — correggere con la manutenzione ordinaria. Motivazione: CVSS 5.5.
Versioni da aggiornare
- Linux Linux Kernel: vulnerabili le versioni dalla
4.4precedenti alla5.10.259→ aggiornare alla5.10.259o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
5.11precedenti alla5.15.210→ aggiornare alla5.15.210o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
5.16precedenti alla6.1.176→ aggiornare alla6.1.176o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.2precedenti alla6.6.140→ aggiornare alla6.6.140o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.7precedenti alla6.12.88→ aggiornare alla6.12.88o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.13precedenti 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.
Patch e advisory
- Patch: git.kernel.org/stable/c/1abd50fc3cfa16fc2074a3c8c27…
- Patch: git.kernel.org/stable/c/26d3a97ad46c7a9226ec04d4bf3…
- Patch: git.kernel.org/stable/c/2aa77a18dc7f2670497fe3ee5ac…
- Patch: git.kernel.org/stable/c/30e513e755bb381afce6fb57cdc…
- Patch: git.kernel.org/stable/c/6d63615c796c085b4984e3031b9…
- Patch: git.kernel.org/stable/c/8637dfb4c1d8a7026ef681f2477…
- Patch: git.kernel.org/stable/c/8c2f1288250a90a4b5cabed5d88…
- Patch: git.kernel.org/stable/c/a1793a48881ec8d26e9c79b0ee6…
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 | ≥ 4.4 < 5.10.259 | 5.10.259 |
| Linux | Linux Kernel | ≥ 5.11 < 5.15.210 | 5.15.210 |
| Linux | Linux Kernel | ≥ 5.16 < 6.1.176 | 6.1.176 |
| Linux | Linux Kernel | ≥ 6.2 < 6.6.140 | 6.6.140 |
| Linux | Linux Kernel | ≥ 6.7 < 6.12.88 | 6.12.88 |
| Linux | Linux Kernel | ≥ 6.13 < 6.18.30 | 6.18.30 |
| Linux | Linux Kernel | ≥ 6.19 < 7.0.7 | 7.0.7 |
Riferimenti
- Patchhttps://git.kernel.org/stable/c/1abd50fc3cfa16fc2074a3c8c2729c50fd9d7043
- Patchhttps://git.kernel.org/stable/c/26d3a97ad46c7a9226ec04d4bf35bd4998a97d16
- Patchhttps://git.kernel.org/stable/c/2aa77a18dc7f2670497fe3ee5acbeda0b57659e5
- Patchhttps://git.kernel.org/stable/c/30e513e755bb381afce6fb57cdc8694136193f22
- Patchhttps://git.kernel.org/stable/c/6d63615c796c085b4984e3031b9fa77fffb47360
- Patchhttps://git.kernel.org/stable/c/8637dfb4c1d8a7026ef681f2477c6de8b71c4003
- Patchhttps://git.kernel.org/stable/c/8c2f1288250a90a4b5cabed5d888d7e3aeed4035
- Patchhttps://git.kernel.org/stable/c/a1793a48881ec8d26e9c79b0ee65753f1c6846a4
- Riferimentohttps://cert-portal.siemens.com/productcert/html/ssa-019113.html
- Riferimentohttps://cert-portal.siemens.com/productcert/html/ssa-457936.html
- Riferimentohttps://cert-portal.siemens.com/productcert/html/ssa-784472.html