CVE-2023-52652 NTB: fix possible name leak in ntb_register_device()

Medium 5.5 Published Updated

A memory leak in the Linux kernel NTB driver occurs when device registration fails, potentially leading to resource exhaustion.

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-52652?

CVE-2023-52652 is a medium-severity memory corruption vulnerability in Linux kernel, published on 1 May 2024. 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:

NTB: fix possible name leak in ntb_register_device()

If device_register() fails in ntb_register_device(), the device name allocated by dev_set_name() should be freed. As per the comment in device_register(), callers should use put_device() to give up the reference in the error path. So fix this by calling put_device() in the error path so that the name can be freed in kobject_cleanup().

As a result of this, put_device() in the error path of ntb_register_device() is removed and the actual error is returned.

[mani: reworded commit message]

Which versions are affected by CVE-2023-52652?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2023-52652?

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-52652 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2023-52652, DEBIAN-CVE-2023-52652, GHSA-2jfm-78v6-9p3x, ROOT-OS-DEBIAN-11-CVE-2023-52652, UBUNTU-CVE-2023-52652.

Is CVE-2023-52652 in your software?

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

Check your SBOMs for free