# CVE-2021-47305: dma-buf/sync_file: Don't leak fences on merge failure

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 15% of CVEs (2026-12-01)
- Published: 2024-05-21T14:35:25.345Z
- Modified: 2026-06-17T04:17:09.110Z
- Weaknesses: CWE-617
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- 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.

(As written by CVE List.)

## Affected

- 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.*; from 5.14 up to *)
- 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

## References

- <https://git.kernel.org/stable/c/19f51c2529339280d2c8c6427cd3e21ddf1ac3f8> (patch)
- <https://git.kernel.org/stable/c/e0355a0ad31a1d677b2a4514206de4902bd550e8> (patch)
- <https://git.kernel.org/stable/c/41f45e91c92c8480242ea448d54e28c753b13902> (patch)
- <https://git.kernel.org/stable/c/0d514185ae792d3a1903c8e1a83899aa996705ce> (patch)
- <https://git.kernel.org/stable/c/19edcd97727aae9362444a859a24d99a8730cb27> (patch)
- <https://git.kernel.org/stable/c/ffe000217c5068c5da07ccb1c0f8cce7ad767435> (patch)

## Sources

- CVE List: [CVE-2021-47305](https://www.cve.org/CVERecord?id=CVE-2021-47305), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2021-47305](https://nvd.nist.gov/vuln/detail/CVE-2021-47305), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-47305 · Whole record: https://cve.day/CVE-2021-47305.json · Rebuilt by cve.day 2026-11-25T22:58:08.787Z
