CVE-2024-56756 nvme-pci: fix freeing of the HMB descriptor table

Medium 5.5 Published Updated

Incorrect memory freeing in the Linux kernel NVMe driver can lead to a use-after-free condition, potentially causing a system crash.

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

CVE-2024-56756 is a medium-severity use after free 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:

nvme-pci: fix freeing of the HMB descriptor table

The HMB descriptor table is sized to the maximum number of descriptors that could be used for a given device, but __nvme_alloc_host_mem could break out of the loop earlier on memory allocation failure and end up using less descriptors than planned for, which leads to an incorrect size passed to dma_free_coherent.

In practice this was not showing up because the number of descriptors tends to be low and the dma coherent allocator always allocates and frees at least a page.

Which versions are affected by CVE-2024-56756?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-56756?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2024-56756 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as AZL-54801, AZL-54830, BELL-CVE-2024-56756, DEBIAN-CVE-2024-56756, GHSA-2398-v7wm-x7gr, UBUNTU-CVE-2024-56756.

Is CVE-2024-56756 in your software?

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

Check your SBOMs for free