7.8high
ASoC: codec: sma1307: Fix memory corruption in sma1307_setting_loaded()
- Severity
- 7.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.15% (higher than 4% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: ASoC: codec: sma1307: Fix memory corruption in sma1307_setting_loaded() The sma1307->set.header_size is how many integers are in the header (there are 8 of them) but instead of allocating space of 8 integers we allocate 8 bytes. This leads to memory corruption when we copy data it on the next line: memcpy(sma1307->set.header, data, sma1307->set.header_size * sizeof(int)); Also since we're immediately copying over the memory in ->set.header, there is no need to zero it in the allocator. Use devm_kmalloc_array() to allocate the memory instead.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 576c57e6b4c1d734bcb7cc33dde9a99a9383b520 before cd59ca8f75dbb42a67fcae975c766114644e36c4, from 576c57e6b4c1d734bcb7cc33dde9a99a9383b520 before 78338108b5a856dc98223a335f147846a8a18c51, 6.13 Not affected: before 6.13, from 6.16.9 up to 6.16.*, from 6.17 up to * | CVE List |
| linux linux_kernel | from 6.13 before 6.16.9, 6.17 | NVD |
All scores
| Linux | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Classification
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: ASoC: codec: sma1307: Fix memory corruption in sma1307_setting_loaded() The sma1307->set.header_size is how many integers are in the header (there are 8 of them) but instead of allocating space of 8 integers we allocate 8 bytes. This leads to memory corruption when we copy data it on the next line: memcpy(sma1307->set.header, data, sma1307->set.header_size * sizeof(int)); Also since we're immediately copying over the memory in ->set.header, there is no need to zero it in the allocator. Use devm_kmalloc_array() to allocate the memory instead.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: ASoC: codec: sma1307: Corrección de corrupción de memoria en sma1307_setting_loaded() El sma1307->set.header_size es la cantidad de enteros que hay en la cabecera (hay 8 de ellos), pero en lugar de asignar espacio para 8 enteros, asignamos 8 bytes. Esto lleva a corrupción de memoria cuando copiamos datos en la siguiente línea: memcpy(sma1307->set.header, data, sma1307->set.header_size * sizeof(int)); Además, dado que estamos copiando inmediatamente la memoria en ->set.header, no hay necesidad de ponerla a cero en el asignador. Use devm_kmalloc_array() para asignar la memoria en su lugar.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-39935 changed 2026-08-05 | CVE Terms of Use |
| NVD | CVE-2025-39935 changed 2026-10-19 | Public domain |