CVE-2021-47541: net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources()
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.
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel use-after-free bug in the mlx4_en Ethernet driver. It was found by static analysis and may be hard to trigger. The main business concern is kernel stability and possible memory-safety exposure on systems using this driver, not a confirmed active attack campaign.
Executive priority
Treat as a targeted Linux maintenance item, not an emergency, unless critical infrastructure uses mlx4_en. Patch during the next appropriate kernel update window after confirming vendor coverage.
Technical view
mlx4_en_try_alloc_resources() called mlx4_en_copy_priv(), whose error path could free tmp->tx_cq. The code then called mlx4_en_alloc_resources(), which dereferenced tmp->tx_cq entries. Stable kernel fixes add a check for mlx4_en_copy_priv() before continuing.
Likely exposure
Exposure is likely limited to Linux systems running affected kernel versions with CONFIG_MLX4_EN enabled or the mlx4_en module loaded, typically systems using Mellanox mlx4 Ethernet hardware. Systems without this driver path are less likely exposed.
Exploitation context
The source bundle does not show KEV listing, public exploitation, CVSS, or a working exploit. The upstream description says the bug was static-analysis-found, cross-reviewed, and may be false positive or hard to trigger.
Researcher notes
Evidence supports a kernel driver memory-safety bug with incomplete exploitability details. Do not assume remote reachability, privilege escalation, or crash impact without additional vendor or upstream analysis.
Mitigation direction
Update to a kernel release containing the referenced stable fixes.
Prioritize hosts using the mlx4_en driver or Mellanox mlx4 network hardware.
If patching is delayed, check vendor distribution advisories for supported mitigations.
Avoid inventing compensating controls; follow kernel or Linux vendor guidance.
Validation and detection
Inventory kernels and identify systems with mlx4_en enabled or loaded.
Compare installed kernel builds against vendor advisories and stable fix inclusion.
Review package changelogs for CVE-2021-47541 or the referenced commits.
Confirm post-update kernels no longer contain the vulnerable code path.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2021-47541 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.