CVE-2021-47541

net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources()

HIGH
7.8
CVSS Score
Published: May 24, 2024 at 03:09 PM UTC
Updated: August 5, 2026 at 09:24 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 0.3%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources() In mlx4_en_try_alloc_resources(), mlx4_en_copy_priv() is called and tmp->tx_cq will be freed on the error path of mlx4_en_copy_priv(). After that mlx4_en_alloc_resources() is called and there is a dereference of &tmp->tx_cq[t][i] in mlx4_en_alloc_resources(), which could lead to a use after free problem on failure of mlx4_en_copy_priv(). Fix this bug by adding a check of mlx4_en_copy_priv() This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_MLX4_EN=m show no new warnings, and our static analyzer no longer warns about this code.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

4.15 ≤ v < 4.19.2204.20 ≤ v < 5.4.1644.7 ≤ v < 4.14.2574.7 ≤ v < 4.19.2204.7 ≤ v < 5.10.844.7 ≤ v < 5.15.74.7 ≤ v < 5.164.7 ≤ v < 5.4.1645.11 ≤ v < 5.15.75.5 ≤ v < 5.10.844.7ec25bc04ed8e12947738468cbe2191f1529f9e39
Vendor states this is fixed in 676dc7d9b15bf8733233a2db1ec3f9091ab34275 (fixed)
Vendor states this is fixed in 75917372eef0dbfb290ae45474314d35f97aea18 (fixed)
Vendor states this is fixed in addad7643142f500080417dd7272f49b7a185570 (fixed)
Vendor states this is fixed in be12572c5ddc8ad7453bada4eec8fa46967dc757 (fixed)
Vendor states this is fixed in e461a9816a1ac5b4aeb61621b817225b61e46a68 (fixed)
Vendor states this is fixed in f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b (fixed)
Vendor states this is fixed in 4.14.257 (unaffected)
Vendor states this is fixed in 4.19.220 (unaffected)
Vendor states this is fixed in 4.7 (unaffected)
Vendor states this is fixed in 5.10.84 (unaffected)
Vendor states this is fixed in 5.15.7 (unaffected)
Vendor states this is fixed in 5.16 (unaffected)
Vendor states this is fixed in 5.4.164 (unaffected)

References (6)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/676dc7d9b15bf8733233a2db1ec3f9091ab34275
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/75917372eef0dbfb290ae45474314d35f97aea18
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/addad7643142f500080417dd7272f49b7a185570
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/be12572c5ddc8ad7453bada4eec8fa46967dc757
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e461a9816a1ac5b4aeb61621b817225b61e46a68
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.8HIGHLinux
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-416

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card