CVE-2023-52929 nvmem: core: fix cleanup after dev_set_name()
A resource leak in the Linux kernel nvmem driver occurs if device name setting fails, potentially leading to memory 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-52929?
CVE-2023-52929 is a medium-severity vulnerability in Linux kernel, published on 27 Mar 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:
nvmem: core: fix cleanup after dev_set_name()
If dev_set_name() fails, we leak nvmem->wp_gpio as the cleanup does not put this. While a minimal fix for this would be to add the gpiod_put() call, we can do better if we split device_register(), and use the tested nvmem_release() cleanup code by initialising the device early, and putting the device.
This results in a slightly larger fix, but results in clear code.
Note: this patch depends on "nvmem: core: initialise nvmem->id early" and "nvmem: core: remove nvmem_config wp_gpio".
[Srini: Fixed subject line and error code handing with wp_gpio while applying.]
Weakness: CWE-459
Which versions are affected by CVE-2023-52929?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2023-52929?
Apply the vendor's patch.
Is CVE-2023-52929 being exploited?
There is no known exploitation of CVE-2023-52929 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2023-52929, DEBIAN-CVE-2023-52929, GHSA-2g5f-4p47-mx3m, UBUNTU-CVE-2023-52929.