3.3low
udmabuf: fix memory leak on last export_udmabuf() error path
- Severity
- 3.3low CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.25% (higher than 17% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: udmabuf: fix memory leak on last export_udmabuf() error path In export_udmabuf(), if dma_buf_fd() fails because the FD table is full, a dma_buf owning the udmabuf has already been created; but the error handling in udmabuf_create() will tear down the udmabuf without doing anything about the containing dma_buf. This leaves a dma_buf in memory that contains a dangling pointer; though that doesn't seem to lead to anything bad except a memory leak. Fix it by moving the dma_buf_fd() call out of export_udmabuf() so that we can give it different error handling. Note that the shape of this code changed a lot in commit 5e72b2b41a21 ("udmabuf: convert udmabuf driver to use folios"); but the memory leak seems to have existed since the introduction of udmabuf.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from fbb0de795078190a9834b3409e4b009cfb18a6d4 before 00ebdef47994206f60546929a0f6f63285497272, from fbb0de795078190a9834b3409e4b009cfb18a6d4 before e469922fbdf6ad729e5dc8d49289b5036a0ecdf8, from fbb0de795078190a9834b3409e4b009cfb18a6d4 before c9fc8428d4255c2128da9c4d5cd92e554d0150cf, from fbb0de795078190a9834b3409e4b009cfb18a6d4 before f49856f525acd5bef52ae28b7da2e001bbe7439e, 4.20 Not affected: before 4.20, from 6.1.191 up to 6.1.*, from 6.6.160 up to 6.6.*, from 6.12.7 up to 6.12.*, from 6.13 up to * | CVE List |
| linux linux_kernel | from 4.20 before 6.12.7, 6.13 | NVD |
All scores
| CISA-ADP | 3.3low CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L |
| 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 no, technical impact partial.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: udmabuf: fix memory leak on last export_udmabuf() error path In export_udmabuf(), if dma_buf_fd() fails because the FD table is full, a dma_buf owning the udmabuf has already been created; but the error handling in udmabuf_create() will tear down the udmabuf without doing anything about the containing dma_buf. This leaves a dma_buf in memory that contains a dangling pointer; though that doesn't seem to lead to anything bad except a memory leak. Fix it by moving the dma_buf_fd() call out of export_udmabuf() so that we can give it different error handling. Note that the shape of this code changed a lot in commit 5e72b2b41a21 ("udmabuf: convert udmabuf driver to use folios"); but the memory leak seems to have existed since the introduction of udmabuf.
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: udmabuf: reparar pérdida de memoria en la última ruta de error export_udmabuf() En export_udmabuf(), si dma_buf_fd() falla porque la tabla FD está llena, ya se ha creado un dma_buf que posee el udmabuf; pero la gestión de errores en udmabuf_create() destruirá el udmabuf sin hacer nada con el dma_buf que lo contiene. Esto deja un dma_buf en la memoria que contiene un puntero colgante; aunque eso no parece conducir a nada malo excepto a una pérdida de memoria. Arréglelo moviendo la llamada dma_buf_fd() fuera de export_udmabuf() para que podamos darle un gestión de errores diferente. Tenga en cuenta que la forma de este código cambió mucho en el commit 5e72b2b41a21 ("udmabuf: convertir el controlador udmabuf para usar folios"); Pero la pérdida de memoria parece haber existido desde la introducción de udmabuf.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-56712 changed 2026-10-30 | CVE Terms of Use |
| NVD | CVE-2024-56712 changed 2026-10-30 | Public domain |