CVE-2024-35883 spi: mchp-pci1xxx: Fix a possible null pointer dereference in pci1xxx_spi_probe

Medium 5.5 Published Updated

A missing null pointer check in the Microchip PCI1xxx SPI driver can cause a kernel crash upon memory allocation failure.

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

CVE-2024-35883 is a medium-severity vulnerability in Linux kernel, published on 19 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:

spi: mchp-pci1xxx: Fix a possible null pointer dereference in pci1xxx_spi_probe

In function pci1xxxx_spi_probe, there is a potential null pointer that may be caused by a failed memory allocation by the function devm_kzalloc. Hence, a null pointer check needs to be added to prevent null pointer dereferencing later in the code.

To fix this issue, spi_bus->spi_int[iter] should be checked. The memory allocated by devm_kzalloc will be automatically released, so just directly return -ENOMEM without worrying about memory leaks.

Weakness: CWE-476

Which versions are affected by CVE-2024-35883?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-35883?

Apply the vendor's patch.

Is CVE-2024-35883 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-35883, DEBIAN-CVE-2024-35883, GHSA-c4v9-g4cm-vgvx, UBUNTU-CVE-2024-35883.

Is CVE-2024-35883 in your software?

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

Check your SBOMs for free