CVE-2021-47438

5.5 MEDIUM

📋 TL;DR

A memory leak vulnerability in the Linux kernel's mlx5 network driver occurs when destroying completion queues fails, causing unreleased memory allocations. This affects systems using Mellanox network adapters with the mlx5 driver. The vulnerability can lead to gradual memory exhaustion over time.

💻 Affected Systems

Products:
  • Linux kernel with mlx5 network driver
Versions: Linux kernel versions before the fix commits (specific versions vary by distribution)
Operating Systems: Linux distributions using affected kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with Mellanox network adapters using the mlx5 driver. Triggered during completion queue destruction operations.

📦 What is this software?

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Sustained exploitation could cause kernel memory exhaustion leading to system instability, crashes, or denial of service requiring reboot.

🟠

Likely Case

Gradual memory leak during normal network operations, potentially causing performance degradation over extended periods.

🟢

If Mitigated

Minimal impact with proper monitoring and memory limits in place.

🌐 Internet-Facing: LOW - Requires local access or specific network driver operations.
🏢 Internal Only: MEDIUM - Could affect servers with Mellanox adapters during network configuration changes.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: NO
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires ability to trigger mlx5_core_destroy_cq() error conditions, typically through privileged operations.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Linux kernel with commits 4f7bddf8c5c01cac74373443b13a68e1c6723a94 or 94b960b9deffc02fc0747afc01f72cc62ab099e3

Vendor Advisory: https://git.kernel.org/stable/c/4f7bddf8c5c01cac74373443b13a68e1c6723a94

Restart Required: Yes

Instructions:

1. Update Linux kernel to version containing the fix. 2. Check distribution-specific security advisories. 3. Reboot system to load patched kernel.

🔧 Temporary Workarounds

Disable mlx5 driver

linux

Remove or blacklist mlx5 driver if Mellanox adapters are not required

echo 'blacklist mlx5_core' > /etc/modprobe.d/blacklist-mlx5.conf
update-initramfs -u
reboot

🧯 If You Can't Patch

  • Monitor system memory usage and kernel logs for memory leak indicators
  • Restrict privileged operations that could trigger mlx5_core_destroy_cq() errors

🔍 How to Verify

Check if Vulnerable:

Check kernel version and if mlx5_core module is loaded: lsmod | grep mlx5_core

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version is patched and check for memory leak using tools like kmemleak or monitoring memory usage

📡 Detection & Monitoring

Log Indicators:

  • Kernel logs showing memory allocation failures
  • kmemleak reports of unreferenced mlx5 objects
  • System logs showing high memory usage

Network Indicators:

  • None specific - this is a local memory management issue

SIEM Query:

source="kernel" AND ("mlx5" OR "memory leak" OR "kmemleak")

🔗 References

📤 Share & Export