SecurityContext

CVE-2021-47541: Linux Kernel - Use After Free

  • Cve: CVE-2021-47541
  • Name: Linux Kernel - Use After Free
  • 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.
  • Impact: Potential kernel crash or privilege escalation due to use-after-free vulnerability.
  • Remediation: Apply the patch that adds a check for mlx4_en_copy_priv() to prevent use-after-free.
  • Vulnerability type: use_after_free
  • Vulnerability impact: denial_of_service, privilege_escalation
  • Requirement type: none
  • Labels source: projectdiscovery
  • Severity: high
  • Cvss score: 7.8
  • Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Epss score: 0.00295
  • Epss percentile: 0.22403
  • Assignee: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
  • Published at: 2024-05-24T15:15:18Z
  • Age in days: 914
  • Modified at: 2026-08-04T10:17:07Z
  • Patch available: yes
  • References total: 6
  • Products total: 1
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-47541
  • Nvd status: modified
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
  • Not known: requirements, hackerone

Cwe

IdName
CWE-416Use After Free

References

Same in every row:

  • Source: nvd
  • Tags: Patch
Url
https://git.kernel.org/stable/c/676dc7d9b15bf8733233a2db1ec3f9091ab34275
https://git.kernel.org/stable/c/75917372eef0dbfb290ae45474314d35f97aea18
https://git.kernel.org/stable/c/addad7643142f500080417dd7272f49b7a185570
https://git.kernel.org/stable/c/be12572c5ddc8ad7453bada4eec8fa46967dc757
https://git.kernel.org/stable/c/e461a9816a1ac5b4aeb61621b817225b61e46a68
https://git.kernel.org/stable/c/f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b

Products

ProductAffectedPlatform boundSourcesUrl
linux:linux_kernel>= 5.11, < 5.15.7; >= 5.5, < 5.10.84; >= 4.20, < 5.4.164; >= 4.15, < 4.19.220; >= 4.7, < 4.14.257nonvd/v1/products/linux/linux_kernel

Projects

RepositoryLink kindsIndexedUrl
torvalds/linuxcna_commit, commityes/v1/repositories/torvalds/linux

Index

  • Checked, none or zero: repositories, repositories high signal, packages

Exploitation

  • Authentication required: yes
  • Exposed hosts: 10038339
  • Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote
  • Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports