CVE-2022-50529

5.5 MEDIUM

📋 TL;DR

This CVE describes a memory leak vulnerability in the Linux kernel's test_firmware module. When misc_register() fails during module initialization, the kernel fails to free allocated memory for the test_firmware configuration name. This affects systems with the test_firmware module loaded, typically during development or testing scenarios.

💻 Affected Systems

Products:
  • Linux kernel
Versions: Specific affected versions not specified in CVE description, but patches exist for multiple stable branches
Operating Systems: Linux distributions using vulnerable kernel versions
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when test_firmware module is loaded (not loaded by default in most distributions). Primarily affects development/testing systems.

⚠️ Risk & Real-World Impact

🔴

Worst Case

Sustained memory exhaustion leading to kernel panic or system instability if the vulnerable code path is repeatedly triggered, potentially causing denial of service.

🟠

Likely Case

Minor memory leak that accumulates slowly over time, primarily affecting systems where test_firmware module is frequently loaded/unloaded during development or testing.

🟢

If Mitigated

No impact on production systems where test_firmware module is not loaded, or minimal impact with proper memory monitoring.

🌐 Internet-Facing: LOW - This vulnerability requires local access to trigger and is not remotely exploitable.
🏢 Internal Only: LOW - Requires privileged access to load kernel modules, making exploitation unlikely in properly secured environments.

🎯 Exploit Status

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

Requires ability to load kernel modules (typically root privileges) and trigger the specific failure condition in misc_register().

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Multiple stable kernel versions with fixes available (see references)

Vendor Advisory: https://git.kernel.org/stable/c/04dd47a2e169f2d4489636afa07ff0469aab49ab

Restart Required: Yes

Instructions:

1. Update Linux kernel to patched version from your distribution vendor. 2. Reboot system to load new kernel. 3. Verify test_firmware module is not loaded unless needed.

🔧 Temporary Workarounds

Prevent test_firmware module loading

linux

Blacklist the test_firmware module to prevent it from being loaded

echo 'blacklist test_firmware' >> /etc/modprobe.d/blacklist.conf
update-initramfs -u

Unload test_firmware module

linux

Remove the module if currently loaded

rmmod test_firmware

🧯 If You Can't Patch

  • Ensure test_firmware module is not loaded in production systems
  • Implement kernel module loading restrictions and monitoring

🔍 How to Verify

Check if Vulnerable:

Check if test_firmware module is loaded: lsmod | grep test_firmware

Check Version:

uname -r

Verify Fix Applied:

Check kernel version is patched: uname -r and verify against distribution security advisories

📡 Detection & Monitoring

Log Indicators:

  • Kernel messages about memory allocation failures
  • System logs showing test_firmware module loading

Network Indicators:

  • None - this is a local vulnerability

SIEM Query:

source="kernel" AND ("test_firmware" OR "misc_register failed")

🔗 References

📤 Share & Export