CVE-2022-50536

7.8 HIGH

📋 TL;DR

A double-free vulnerability in the Linux kernel's BPF sockmap subsystem allows local attackers to cause a use-after-free condition. This can lead to kernel memory corruption, system crashes, or potential privilege escalation. Affects Linux systems with BPF sockmap functionality enabled.

💻 Affected Systems

Products:
  • Linux Kernel
Versions: Kernel versions with the vulnerable code (specific versions not provided in CVE, but patches available for stable branches)
Operating Systems: Linux distributions using affected kernel versions
Default Config Vulnerable: ✅ No
Notes: Only vulnerable if BPF sockmap functionality is enabled and used. Many distributions may not have this enabled by default.

⚠️ Risk & Real-World Impact

🔴

Worst Case

Kernel panic leading to system crash or potential privilege escalation to root via kernel memory corruption.

🟠

Likely Case

System instability, kernel crashes, or denial of service on affected systems.

🟢

If Mitigated

Limited impact if BPF sockmap is not used or systems are patched.

🌐 Internet-Facing: LOW - Requires local access to exploit.
🏢 Internal Only: MEDIUM - Local attackers or compromised user accounts could exploit this.

🎯 Exploit Status

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

Requires local access and ability to trigger BPF sockmap operations. No public exploit code identified.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Patched in stable kernel releases via commits referenced in CVE

Vendor Advisory: https://git.kernel.org/stable/c/113236e8f49f262f318c00ebb14b15f4834e87c1

Restart Required: Yes

Instructions:

1. Update Linux kernel to patched version. 2. Check distribution-specific security advisories. 3. Reboot system after kernel update.

🔧 Temporary Workarounds

Disable BPF sockmap

linux

Disable BPF sockmap functionality if not required

echo 0 > /proc/sys/net/core/bpf_jit_enable
Remove sockmap BPF programs if loaded

🧯 If You Can't Patch

  • Restrict local user access to systems
  • Monitor for kernel panic/crash events and investigate suspicious BPF activity

🔍 How to Verify

Check if Vulnerable:

Check kernel version and if BPF sockmap is enabled: uname -r and check /proc/sys/net/core/bpf_jit_enable

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version is updated beyond vulnerable commits and system is stable after applying BPF sockmap operations

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic logs
  • refcount_t warnings in kernel logs
  • TCP socket state errors

Network Indicators:

  • Unusual BPF program loading
  • Suspicious local socket operations

SIEM Query:

source="kernel" AND ("refcount_t" OR "TCP socket in state" OR "use-after-free")

🔗 References

📤 Share & Export