# CVE-2023-53181: dma-buf/dma-resv: Stop leaking on krealloc() 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.16%, higher than 5% of CVEs (2026-12-01)
- Published: 2025-09-15T14:04:32.098Z
- Modified: 2026-06-17T06:44:27.210Z
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

dma-buf/dma-resv: Stop leaking on krealloc() failure

Currently dma_resv_get_fences() will leak the previously
allocated array if the fence iteration got restarted and
the krealloc_array() fails.

Free the old array by hand, and make sure we still clear
the returned *fences so the caller won't end up accessing
freed memory. Some (but not all) of the callers of
dma_resv_get_fences() seem to still trawl through the
array even when dma_resv_get_fences() failed. And let's
zero out *num_fences as well for good measure.

(As written by CVE List.)

## Affected

- Linux Linux: from d3c80698c9f58a0683badf78793eebaa0c71afbd before 19e7b9f1f7e1cb92a4cc53b4c064f7fb4b1f1983; from d3c80698c9f58a0683badf78793eebaa0c71afbd before 819656cc03dec7f7f7800274dfbc8eb49f888e9f; from d3c80698c9f58a0683badf78793eebaa0c71afbd before 05abb3be91d8788328231ee02973ab3d47f5e3d2; 5.16 (not affected: before 5.16; from 6.1.42 up to 6.1.*; from 6.4.7 up to 6.4.*; from 6.5 up to *)
- linux linux_kernel: from 5.16 before 6.1.42; from 6.2 before 6.4.7; 6.5

## References

- <https://git.kernel.org/stable/c/19e7b9f1f7e1cb92a4cc53b4c064f7fb4b1f1983> (patch)
- <https://git.kernel.org/stable/c/819656cc03dec7f7f7800274dfbc8eb49f888e9f> (patch)
- <https://git.kernel.org/stable/c/05abb3be91d8788328231ee02973ab3d47f5e3d2> (patch)

## Sources

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

---

Page: https://cve.day/CVE-2023-53181 · Whole record: https://cve.day/CVE-2023-53181.json · Rebuilt by cve.day 2026-11-25T22:58:34.760Z
