CVE-2023-53181: dma-buf/dma-resv: Stop leaking on krealloc() failure
In the Linux kernel, the following vulnerability has been resolved:
dma-buf/dma-resv: Stop leaking on krealloc() failure
Currently dmaresvgetfences() will leak the previously allocated array if the fence iteration got restarted and the kreallocarray() 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 dmaresvgetfences() seem to still trawl through the array even when dmaresvgetfences() failed. And let's zero out numfences as well for good measure.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In dma_resv_get_fences(), free the old array if krealloc_array() fails, clear the returned *fences, and set *num_fences to zero so callers do not access freed memory.
Event History
Frequently Asked Questions
What is the severity of CVE-2023-53181?
The severity of CVE-2023-53181 is classified as moderate due to the potential for memory leaks in the Linux kernel.
How do I fix CVE-2023-53181?
To fix CVE-2023-53181, upgrade your Linux kernel to the latest patched version provided by your distribution.
What systems are affected by CVE-2023-53181?
CVE-2023-53181 affects various versions of the Linux kernel implementing dma-buf and dma-resv functionalities.
Is CVE-2023-53181 a remote exploitable vulnerability?
CVE-2023-53181 is not considered a remote exploitable vulnerability as it requires local access to the affected system.
What is the impact of CVE-2023-53181 on system performance?
The impact of CVE-2023-53181 may lead to resource leakage, potentially degrading system performance over time if not addressed.