CVE-2025-38335

5.5 MEDIUM

📋 TL;DR

This CVE describes a race condition vulnerability in the Linux kernel's gpio-keys driver when PREEMPT_RT is enabled. The issue occurs when the gpio_keys_irq_timer() callback attempts to acquire a spinlock in hard interrupt context, which can cause system instability or crashes. This affects Linux systems using PREEMPT_RT with gpio-keys functionality.

💻 Affected Systems

Products:
  • Linux kernel
Versions: Specific affected versions not explicitly stated in CVE description; check git commits for exact ranges
Operating Systems: Linux distributions with PREEMPT_RT patches enabled
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when PREEMPT_RT (real-time) kernel configuration is enabled and gpio-keys driver is in use. Most standard Linux distributions do not enable PREEMPT_RT by default.

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

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

System crash or kernel panic leading to denial of service, potentially causing data loss or service disruption.

🟠

Likely Case

System instability, occasional crashes, or performance degradation when gpio-keys are actively used with PREEMPT_RT enabled.

🟢

If Mitigated

Minor performance impact or no noticeable effect if gpio-keys functionality is not heavily utilized.

🌐 Internet-Facing: LOW - This is a kernel-level driver issue not directly exposed to network interfaces.
🏢 Internal Only: MEDIUM - Affects system stability for devices using gpio-keys with PREEMPT_RT, particularly embedded systems and IoT devices.

🎯 Exploit Status

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

Exploitation requires local access and specific hardware/configuration conditions. This is primarily a stability issue rather than a security vulnerability for privilege escalation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check kernel version containing commits: 664e5a6f541ff226621487d1280d2ec28e86be28, a7b79db25846459de63ca8974268f0c41c734c4b, a8f01e51109f77229e426b57c5d19251b462c6aa, ec8f5da79b425deef5aebacdd4fe645620cd4f0b, f4a8f561d08e39f7833d4a278ebfb12a41eef15f

Vendor Advisory: https://git.kernel.org/stable/c/664e5a6f541ff226621487d1280d2ec28e86be28

Restart Required: Yes

Instructions:

1. Update Linux kernel to version containing the fix commits
2. Rebuild kernel if using custom kernel
3. Reboot system to load new kernel

🔧 Temporary Workarounds

Disable PREEMPT_RT

linux

Switch to standard kernel configuration without real-time patches

# Reconfigure kernel without PREEMPT_RT option
# Rebuild and install kernel

Disable gpio-keys module

linux

Remove or blacklist gpio-keys driver if not needed

# Blacklist module: echo 'blacklist gpio_keys' >> /etc/modprobe.d/blacklist.conf
# Rebuild initramfs if needed
# Reboot

🧯 If You Can't Patch

  • Monitor system logs for gpio-keys related crashes and restart affected services
  • Consider migrating to non-PREEMPT_RT kernel if stability is critical

🔍 How to Verify

Check if Vulnerable:

Check if PREEMPT_RT is enabled: cat /sys/kernel/realtime, Check if gpio-keys module is loaded: lsmod | grep gpio_keys

Check Version:

uname -r

Verify Fix Applied:

Check kernel version contains fix commits: uname -r, Verify no gpio-keys related crashes in system logs: dmesg | grep -i gpio_keys

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic messages mentioning gpio_keys_irq_timer
  • Sleeping function called from invalid context errors
  • rt_spin_lock related warnings in dmesg

Network Indicators:

  • None - this is a local kernel issue

SIEM Query:

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

🔗 References

📤 Share & Export