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

Medium 5.5 Published Updated

A memory leak in the Linux kernel's dma-resv subsystem can lead to resource exhaustion or potential use-after-free issues if krealloc fails.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2023-53181?

CVE-2023-53181 is a medium-severity memory corruption vulnerability in Linux kernel, published on 15 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Which versions are affected by CVE-2023-53181?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2023-53181?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2023-53181 being exploited?

There is no known exploitation of CVE-2023-53181 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2023-53181, DEBIAN-CVE-2023-53181, GHSA-pjxh-qq38-qww3, UBUNTU-CVE-2023-53181.

Is CVE-2023-53181 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free