CVE-2024-42151

5.5 MEDIUM

📋 TL;DR

A Linux kernel BPF subsystem vulnerability where the verifier could incorrectly optimize away NULL pointer checks in certain BPF programs, potentially leading to kernel NULL pointer dereference. This affects systems running vulnerable Linux kernel versions with BPF enabled. The vulnerability requires local access or ability to load BPF programs.

💻 Affected Systems

Products:
  • Linux kernel
Versions: Specific affected versions not explicitly stated in CVE, but patches available for stable kernel trees
Operating Systems: Linux distributions using vulnerable kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Requires BPF subsystem to be enabled and accessible. Systems with BPF disabled or restricted via kernel lockdown are less vulnerable.

📦 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 allowing local privilege escalation if combined with other vulnerabilities.

🟠

Likely Case

System crash or instability when specific BPF programs are loaded, resulting in denial of service for affected systems.

🟢

If Mitigated

No impact if BPF is disabled or proper kernel patches are applied.

🌐 Internet-Facing: LOW - Requires local access or ability to load BPF programs, not directly exploitable over network.
🏢 Internal Only: MEDIUM - Local users or processes with CAP_BPF capability could trigger the vulnerability, potentially causing system instability.

🎯 Exploit Status

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

Exploitation requires ability to load BPF programs (typically requires CAP_BPF or root privileges). The vulnerability is in the BPF verifier logic during program validation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Patches available in stable kernel trees via git commits: 1479eaff1f16983d8fda7c5a08a586c21891087d and 7f79097b0de97a486b137b750d7dd7b20b519d23

Vendor Advisory: https://git.kernel.org/stable/c/1479eaff1f16983d8fda7c5a08a586c21891087d

Restart Required: Yes

Instructions:

1. Update Linux kernel to patched version from distribution vendor. 2. Rebuild kernel if using custom kernel with patches. 3. Reboot system to load new kernel.

🔧 Temporary Workarounds

Disable BPF subsystem

linux

Disable BPF functionality to prevent loading of vulnerable BPF programs

echo 1 > /proc/sys/kernel/unprivileged_bpf_disabled
sysctl -w kernel.unprivileged_bpf_disabled=1

Restrict BPF capabilities

linux

Limit which users can load BPF programs using Linux capabilities

setcap -r /path/to/binary
Remove CAP_BPF from non-essential processes

🧯 If You Can't Patch

  • Implement strict BPF program allowlisting to control which programs can be loaded
  • Monitor system logs for BPF program loading attempts and kernel panic events

🔍 How to Verify

Check if Vulnerable:

Check kernel version and verify if BPF subsystem is enabled: cat /proc/sys/kernel/unprivileged_bpf_disabled

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version includes the fix commits or check with distribution's security advisory

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic messages
  • BPF program loading failures
  • NULL pointer dereference in kernel logs

Network Indicators:

  • Not applicable - local vulnerability

SIEM Query:

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

🔗 References

📤 Share & Export