CVE-2021-47523

IB/hfi1: Fix leak of rcvhdrtail_dummy_kvaddr

State
Published
Severity
Not scored
Published
May 24, 2024
Updated
May 11, 2026
Reserved
May 24, 2024

Read the record on cve.org

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().

Scores

The record has no CVSS score.

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • 46b010d3eeb8eb29c740c4ef09c666485f5c07e6 to before 2c08271f4ed0e24633b3f81ceff61052b9d45efcAffected
  • 46b010d3eeb8eb29c740c4ef09c666485f5c07e6 to before 834d0fb978643eaf09da425de197cc16a7c2761bAffected
  • 46b010d3eeb8eb29c740c4ef09c666485f5c07e6 to before 60a8b5a1611b4a26de4839ab9c1fc2a9cf3e17c1Affected
LinuxLinux
  • 4.5Affected
  • before 4.5Not affected
  • 5.10.85 through 5.10.*Not affected
  • 5.15.8 through 5.15.*Not affected
  • 5.16 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.