5.5medium
dma-buf/sync_file: Don't leak fences on merge failure
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.24% (higher than 15% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: dma-buf/sync_file: Don't leak fences on merge failure Each add_fence() call does a dma_fence_get() on the relevant fence. In the error path, we weren't calling dma_fence_put() so all those fences got leaked. Also, in the krealloc_array failure case, we weren't freeing the fences array. Instead, ensure that i and fences are always zero-initialized and dma_fence_put() all the fences and kfree(fences) on every error path.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from a02b9dc90d844cc7df7b63264e7920cc425052d9 before 19f51c2529339280d2c8c6427cd3e21ddf1ac3f8, from a02b9dc90d844cc7df7b63264e7920cc425052d9 before e0355a0ad31a1d677b2a4514206de4902bd550e8, from a02b9dc90d844cc7df7b63264e7920cc425052d9 before 41f45e91c92c8480242ea448d54e28c753b13902, from a02b9dc90d844cc7df7b63264e7920cc425052d9 before 0d514185ae792d3a1903c8e1a83899aa996705ce, from a02b9dc90d844cc7df7b63264e7920cc425052d9 before 19edcd97727aae9362444a859a24d99a8730cb27, from a02b9dc90d844cc7df7b63264e7920cc425052d9 before ffe000217c5068c5da07ccb1c0f8cce7ad767435, 4.9 Not affected: before 4.9, from 4.14.241 up to 4.14.*, from 4.19.199 up to 4.19.*, from 5.4.135 up to 5.4.*, from 5.10.53 up to 5.10.*, from 5.13.5 up to 5.13.* | CVE List |
| linux linux_kernel | from 4.9 before 4.14.241, from 4.15 before 4.19.199, from 4.20 before 5.4.135, from 5.5 before 5.10.53, from 5.11 before 5.13.5, 5.14 | NVD |
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: dma-buf/sync_file: Don't leak fences on merge failure Each add_fence() call does a dma_fence_get() on the relevant fence. In the error path, we weren't calling dma_fence_put() so all those fences got leaked. Also, in the krealloc_array failure case, we weren't freeing the fences array. Instead, ensure that i and fences are always zero-initialized and dma_fence_put() all the fences and kfree(fences) on every error path.
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: dma-buf/sync_file: no filtrar barreras en caso de falla de fusión. Cada llamada a add_fence() realiza un dma_fence_get() en la barrera relevante. En la ruta del error, no estábamos llamando a dma_fence_put() por lo que se filtraron todas esas barreras. Además, en el caso de falla de krealloc_array, no estábamos liberando la matriz de vallas. En su lugar, asegúrese de que i y las vallas estén siempre inicializadas en cero y dma_fence_put() todas las vallas y kfree(fences) en cada ruta de error.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-47305 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2021-47305 changed 2026-06-17 | Public domain |