7.5high
can: m_can: m_can_read_fifo: fix memory leak in error branch
- Severity
- 7.5high CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.50% (higher than 44% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: can: m_can: m_can_read_fifo: fix memory leak in error branch In m_can_read_fifo(), if the second call to m_can_fifo_read() fails, the function jump to the out_fail label and returns without calling m_can_receive_skb(). This means that the skb previously allocated by alloc_can_skb() is not freed. In other terms, this is a memory leak. This patch adds a goto label to destroy the skb if an error occurs. Issue was found with GCC -fanalyzer, please follow the link below for details.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from e39381770ec9ca3c51d8b9bd9cc6e01d78ea974a before 75a422165477dd12d2d20aa7c9ee7c9a281c9908, from e39381770ec9ca3c51d8b9bd9cc6e01d78ea974a before 31cb32a590d62b18f69a9a6d433f4e69c74fdd56, 5.15 Not affected: before 5.15, from 5.15.8 up to 5.15.*, from 5.16 up to * | CVE List |
| linux linux_kernel | from e39381770ec9 before 75a422165477, from e39381770ec9 before 31cb32a590d6, 5.15, from 5.15 before 5.15.8 Not affected: before 5.15, from 5.15.8 before 5.16, 5.16 | CVE List, NVD |
All scores
| CISA-ADP | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: can: m_can: m_can_read_fifo: fix memory leak in error branch In m_can_read_fifo(), if the second call to m_can_fifo_read() fails, the function jump to the out_fail label and returns without calling m_can_receive_skb(). This means that the skb previously allocated by alloc_can_skb() is not freed. In other terms, this is a memory leak. This patch adds a goto label to destroy the skb if an error occurs. Issue was found with GCC -fanalyzer, please follow the link below for details.
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: can: m_can: m_can_read_fifo: corrige la pérdida de memoria en la rama de error En m_can_read_fifo(), si la segunda llamada a m_can_fifo_read() falla, la función salta a la etiqueta out_fail y regresa sin llamar m_can_receive_skb(). Esto significa que el skb previamente asignado por alloc_can_skb() no se libera. En otras palabras, se trata de una pérdida de memoria. Este parche agrega una etiqueta goto para destruir el skb si ocurre un error. Se encontró un problema con GCC -fanalyzer; siga el enlace a continuación para obtener más detalles.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-47519 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2021-47519 changed 2026-06-17 | Public domain |