CVE-2024-56745 PCI: Fix reset_method_store() memory leak
A memory leak in the Linux kernel PCI subsystem allows attackers to cause denial of service by exhausting kernel memory.
- 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-2024-56745?
CVE-2024-56745 is a low-severity memory corruption vulnerability in Linux kernel, published on 29 Dec 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:
PCI: Fix reset_method_store() memory leak
In reset_method_store(), a string is allocated via kstrndup() and assigned to the local "options". options is then used in with strsep() to find spaces:
while ((name = strsep(&options, " ")) != NULL) {
If there are no remaining spaces, then options is set to NULL by strsep(), so the subsequent kfree(options) doesn't free the memory allocated via kstrndup().
Fix by using a separate tmp_options to iterate with strsep() so options is preserved.
Weakness: CWE-401
Which versions are affected by CVE-2024-56745?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-56745?
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-2024-56745 being exploited?
There is no known exploitation of CVE-2024-56745 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-55005, AZL-55112, BELL-CVE-2024-56745, DEBIAN-CVE-2024-56745, GHSA-jxx5-v8qw-45p6, UBUNTU-CVE-2024-56745.