CVE-2022-50225

5.5 MEDIUM

📋 TL;DR

This CVE describes a race condition vulnerability in the RISC-V uprobe implementation in the Linux kernel. When handling user-space probes, improper clearing/setting of the SPIE (Supervisor Previous Interrupt Enable) bit can cause a page fault while interrupts are disabled, leading to a kernel warning and potential system instability. This affects systems running Linux kernels with RISC-V architecture support.

💻 Affected Systems

Products:
  • Linux kernel
Versions: Specific affected versions not explicitly stated in CVE, but references indicate fixes in stable kernel trees
Operating Systems: Linux distributions running on RISC-V architecture
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with RISC-V architecture. Vulnerability triggers when uprobe functionality is used.

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

⚠️ Risk & Real-World Impact

🔴

Worst Case

Kernel panic or system crash due to the sleeping function being called from invalid context while interrupts are disabled, leading to denial of service.

🟠

Likely Case

Kernel warning messages in logs and potential system instability or crashes when uprobe functionality is used on RISC-V systems.

🟢

If Mitigated

Minor performance impact from kernel warnings, but system remains operational if uprobe functionality is not actively used.

🌐 Internet-Facing: LOW - This is a local kernel vulnerability requiring local access to trigger.
🏢 Internal Only: MEDIUM - Local users or processes could potentially trigger this condition, causing system instability.

🎯 Exploit Status

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

Requires local access and ability to trigger uprobe functionality. More of a stability issue than a security exploit.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Patches available in stable kernel trees (commits: 3811d51778900064d27d8c9a98f73410fb3b471d, 3dbe5829408bc1586f75b4667ef60e5aab0209c7, 73fc099eaefd9a92c83b6c07dad066411fd5a192, c71e000db8536d27ec410abb3e314896a78b4f19)

Vendor Advisory: https://git.kernel.org/stable/c/3811d51778900064d27d8c9a98f73410fb3b471d

Restart Required: Yes

Instructions:

1. Update to a patched Linux kernel version containing the fix commits. 2. For RISC-V specific distributions, check vendor updates. 3. Reboot system after kernel update.

🔧 Temporary Workarounds

Disable uprobe functionality

linux

Disable user-space probe functionality to prevent triggering the vulnerability

echo 0 > /sys/kernel/debug/tracing/uprobe_events
echo 0 > /sys/kernel/debug/tracing/events/uprobes/enable

🧯 If You Can't Patch

  • Restrict access to debugfs and tracing functionality to prevent uprobe usage
  • Monitor kernel logs for WARN messages related to sleeping functions called from invalid context

🔍 How to Verify

Check if Vulnerable:

Check if system is RISC-V architecture and if uprobe functionality is enabled: 'uname -m' should show riscv and check /sys/kernel/debug/tracing/uprobe_events

Check Version:

uname -r

Verify Fix Applied:

Check kernel version includes the fix commits or verify with vendor that patch is applied

📡 Detection & Monitoring

Log Indicators:

  • Kernel WARN messages about 'sleeping function called from invalid context'
  • References to 'arch_uprobe_pre_xol' or 'SR_SPIE' in kernel logs
  • Page fault errors while interrupts are disabled

Network Indicators:

  • None - this is a local kernel issue

SIEM Query:

source="kernel" AND ("sleeping function called from invalid context" OR "arch_uprobe" OR "SR_SPIE")

🔗 References

📤 Share & Export