CVE-2021-47523 IB/hfi1: Fix leak of rcvhdrtail_dummy_kvaddr

Medium 5.5 Published Updated

A memory leak in the Linux kernel IB/hfi1 driver allows attackers to cause resource exhaustion and denial of service via repeated device reinitialization.

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-2021-47523?

CVE-2021-47523 is a medium-severity vulnerability in Linux kernel, published on 24 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:

IB/hfi1: Fix leak of rcvhdrtail_dummy_kvaddr

This buffer is currently allocated in hfi1_init():

if (reinit) ret = init_after_reset(dd); else ret = loadtime_init(dd); if (ret) goto done;

/* allocate dummy tail memory for all receive contexts */ dd->rcvhdrtail_dummy_kvaddr = dma_alloc_coherent(&dd->pcidev->dev, sizeof(u64), &dd->rcvhdrtail_dummy_dma, GFP_KERNEL);

if (!dd->rcvhdrtail_dummy_kvaddr) { dd_dev_err(dd, "cannot allocate dummy tail memory\n"); ret = -ENOMEM; goto done; }

The reinit triggered path will overwrite the old allocation and leak it.

Fix by moving the allocation to hfi1_alloc_devdata() and the deallocation to hfi1_free_devdata().

Weakness: CWE-401

Which versions are affected by CVE-2021-47523?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2021-47523?

Apply the vendor's patch.

Is CVE-2021-47523 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-47523, UBUNTU-CVE-2021-47523.

Is CVE-2021-47523 in your software?

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

Check your SBOMs for free