CVE-2022-50352

5.5 MEDIUM

📋 TL;DR

This is a memory leak vulnerability in the Linux kernel's HNS network driver. When device registration fails during module probing, the kernel doesn't properly clean up allocated memory, leading to resource exhaustion over time. Systems using affected Linux kernel versions with HNS networking hardware are vulnerable.

💻 Affected Systems

Products:
  • Linux kernel with HNS network driver
Versions: Specific kernel versions containing the vulnerable code (check git commits for exact ranges)
Operating Systems: Linux distributions using affected kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems using HNS networking hardware (Huawei Network System). Requires the hnae module to be loaded.

📦 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 →

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 lead to kernel memory exhaustion, causing system instability, crashes, or denial of service through resource depletion.

🟠

Likely Case

Memory leak accumulates over time during device registration failures, potentially causing performance degradation or system instability after repeated failures.

🟢

If Mitigated

With proper monitoring and patching, impact is limited to temporary resource usage spikes during device registration failures.

🌐 Internet-Facing: LOW - This requires local access or ability to trigger device registration failures, not directly exploitable over network.
🏢 Internal Only: MEDIUM - Requires local access or ability to load/unload kernel modules, but could be exploited by malicious insiders or through other local privilege escalation vectors.

🎯 Exploit Status

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

Exploitation requires ability to trigger device registration failures, typically through module loading/unloading or fault injection. Not directly remote exploitable.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Kernel versions with fixes from the provided git commits

Vendor Advisory: https://git.kernel.org/stable/c/02dc0db19d944b4a90941db505ecf1aaec714be4

Restart Required: No

Instructions:

1. Update Linux kernel to version containing fix commits
2. Rebuild kernel if using custom kernel
3. Load updated kernel modules
4. No system restart required for kernel module updates

🔧 Temporary Workarounds

Disable HNS module

all

Prevent loading of vulnerable hnae module if HNS hardware not required

echo 'blacklist hnae' >> /etc/modprobe.d/blacklist.conf
rmmod hnae

🧯 If You Can't Patch

  • Monitor kernel memory usage for unusual leaks
  • Restrict module loading capabilities to prevent malicious exploitation

🔍 How to Verify

Check if Vulnerable:

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

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version includes fix commits and test module loading/unloading while monitoring memory

📡 Detection & Monitoring

Log Indicators:

  • Kernel oops messages
  • Memory allocation failures in dmesg
  • Repeated module load failures

Network Indicators:

  • None - this is a local kernel vulnerability

SIEM Query:

source="kernel" AND ("hnae" OR "memory leak" OR "slab error")

🔗 References

📤 Share & Export