CVE-2021-47541·Kernel vulnerability
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.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.15.7
- Published
- 2024-05-24
Affected versions
From: 5.11
Until: 5.15.7
Fixed in: 5.15.7
How to fix this CVE
Update your Linux kernel to version 5.15.7 or later to resolve a use-after-free vulnerability in the MLX4 Ethernet driver that could allow local privilege escalation. Systems running kernel versions 5.11 through 5.15.6 should prioritize this update immediately. Verify the patch is applied and reboot the system to complete remediation.
sudo dnf update kernel kernel-devel && sudo rebootDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check current kernel version with `uname -r` and compare against affected range 5.11.x to 5.15.6
- Step 2: Verify MLX4 Ethernet driver is loaded with `lsmod | grep mlx4_en` — if empty, the vulnerable code path is not active
- Step 3: Search kernel logs for mlx4_en allocation failures with `dmesg | grep -i 'mlx4_en.*alloc.*fail'` or `journalctl -k | grep mlx4_en`
- Step 4: After patching, confirm kernel version is 5.15.7+ with `uname -r` and verify driver reloaded with `rmmod mlx4_en && modprobe mlx4_en`
FAQ
What is CVE-2021-47541?
CVE-2021-47541 is a use-after-free vulnerability in the Linux kernel's MLX4 Ethernet driver allocation logic that occurs when memory is freed prematurely during resource initialization, potentially allowing local attackers to cause denial of service or escalate privileges.
Is CVE-2021-47541 being actively exploited?
No, there is no evidence of active exploitation in the wild. This vulnerability was discovered through static code analysis and requires local access to trigger, making opportunistic exploitation unlikely.
What versions of Kernel are affected by CVE-2021-47541?
Linux kernel versions 5.11.0 through 5.15.6 are affected. The fix was released in kernel 5.15.7 and backported to stable branches.
How do I check if my server is vulnerable to CVE-2021-47541?
Run `uname -r` to check your kernel version — if it shows 5.11 through 5.15.6, you are vulnerable. Also verify MLX4 is in use with `lsmod | grep mlx4_en`; if no output, the driver is not loaded and this specific code path is not exposed.
Does Defensia detect CVE-2021-47541?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Kernel is installed on a monitored server, CVE-2021-47541 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- 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
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47541. Free for 1 server.
Get started free