CVE-2024-56773

5.5 MEDIUM

📋 TL;DR

A NULL pointer dereference vulnerability in the Linux kernel's KUnit testing framework could cause kernel crashes or denial of service. This affects Linux systems running vulnerable kernel versions with KUnit enabled. The vulnerability is in kunit_device_driver_test() where kunit_kzalloc() may return NULL without proper checking.

💻 Affected Systems

Products:
  • Linux Kernel
Versions: Specific vulnerable kernel versions containing the bug (check git commits for exact ranges)
Operating Systems: Linux distributions using affected kernel versions
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when KUnit testing framework is enabled and being used. Most production systems likely have KUnit disabled.

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

⚠️ Risk & Real-World Impact

🔴

Worst Case

Kernel panic leading to system crash and denial of service, potentially requiring physical access to restart affected systems.

🟠

Likely Case

Kernel crash or system instability when KUnit tests are executed, causing temporary denial of service until system reboot.

🟢

If Mitigated

Minimal impact if KUnit testing framework is not actively used or system has proper monitoring and redundancy.

🌐 Internet-Facing: LOW - This requires local access or kernel module loading capabilities to trigger.
🏢 Internal Only: MEDIUM - Internal users with sufficient privileges could trigger this, potentially causing system instability.

🎯 Exploit Status

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

Requires ability to load kernel modules or trigger KUnit tests. Not directly exploitable from remote.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Kernel versions containing commits 435c20eed572a95709b1536ff78832836b2f91b1 or 5d28fac59369b5d3c48cdf09e50275a61ff91202

Vendor Advisory: https://git.kernel.org/stable/c/435c20eed572a95709b1536ff78832836b2f91b1

Restart Required: Yes

Instructions:

1. Update Linux kernel to patched version from your distribution vendor. 2. Rebuild kernel if compiling from source with the fix. 3. Reboot system to load new kernel.

🔧 Temporary Workarounds

Disable KUnit Framework

linux

Disable KUnit testing framework in kernel configuration to prevent triggering the vulnerability

Disable CONFIG_KUNIT in kernel configuration and rebuild kernel

🧯 If You Can't Patch

  • Restrict kernel module loading to trusted users only
  • Disable KUnit testing framework if enabled in current kernel configuration

🔍 How to Verify

Check if Vulnerable:

Check kernel version and verify if KUnit is enabled. Vulnerable if using affected kernel version with KUnit enabled.

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version includes the fix commits or check with 'grep -r kunit_device_driver_test /proc/kallsyms' to see if function exists (should be patched).

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic messages
  • NULL pointer dereference errors in kernel logs
  • System crash/reboot events

Network Indicators:

  • None - local vulnerability only

SIEM Query:

source="kernel" AND ("NULL pointer dereference" OR "kernel panic" OR "kunit")

🔗 References

📤 Share & Export