CVE-2025-38352 Overview
CVE-2025-38352 is a race condition vulnerability in the Linux kernel's POSIX CPU timers subsystem. The flaw exists in the interaction between handle_posix_cpu_timers() and posix_cpu_timer_del() functions, where an exiting non-autoreaping task that has passed exit_notify() and calls handle_posix_cpu_timers() from an IRQ context can be reaped by its parent or debugger immediately after unlock_task_sighand(). This creates a Time-of-Check Time-of-Use (TOCTOU) race condition that can lead to system instability and potential privilege escalation.
Critical Impact
This vulnerability is actively exploited in the wild and is listed in CISA's Known Exploited Vulnerabilities catalog. A proof-of-concept exploit is publicly available, making immediate patching critical for affected systems.
Affected Products
- Linux Kernel (multiple versions including 6.16-rc1)
- Debian Linux 11.0
Discovery Timeline
- 2025-07-22 - CVE-2025-38352 published to NVD
- 2026-01-08 - Last updated in NVD database
Technical Details for CVE-2025-38352
Vulnerability Analysis
This vulnerability stems from a race condition in the Linux kernel's POSIX CPU timer implementation. When a process is exiting and has already passed the exit_notify() stage, it may still call handle_posix_cpu_timers() from an interrupt request (IRQ) handler. The critical issue occurs after unlock_task_sighand() is called, at which point the task can be reaped by its parent process or an attached debugger.
If a concurrent call to posix_cpu_timer_del() executes during this window, it cannot properly detect the timer->it.cpu.firing != 0 condition because cpu_timer_task_rcu() and/or lock_task_sighand() will fail. This creates a dangerous state where timer deletion operations may operate on freed or invalid memory structures.
The vulnerability is classified as CWE-367 (Time-of-Check Time-of-Use Race Condition), which is a subset of race condition vulnerabilities where a gap between checking a resource's state and using it allows for exploitation.
Root Cause
The root cause is the lack of proper synchronization between the timer firing state check and the task's exit state in run_posix_cpu_timers(). The code path did not account for the scenario where a task could be reaped between unlocking the signal handler and completing timer operations. The fix adds a tsk->exit_state check in run_posix_cpu_timers() to prevent timer handling on tasks that are in the process of being reaped.
When CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y is enabled, this vulnerability does not manifest because exit_task_work() is called before exit_notify(), ensuring proper cleanup ordering. However, on configurations without this option, the race window exists and can be exploited.
Attack Vector
The attack requires local access to the system. An attacker with the ability to create and manipulate processes can exploit this race condition by:
- Creating a process with POSIX CPU timers configured
- Triggering the exit path while the timer is in a firing state
- Racing the timer deletion with the process reaping to cause memory corruption or use-after-free conditions
The exploitation window is tight but feasible, particularly on multi-core systems where concurrent execution paths are more likely. The publicly available proof-of-concept demonstrates the exploitation technique.
Detection Methods for CVE-2025-38352
Indicators of Compromise
- Unexpected kernel panics or oops messages referencing posix_cpu_timer functions
- System log entries showing memory corruption in timer-related kernel structures
- Unusual process behavior during exit sequences, particularly with POSIX timers attached
- Kernel crash dumps indicating race conditions in handle_posix_cpu_timers() or posix_cpu_timer_del()
Detection Strategies
- Monitor kernel logs for messages related to POSIX CPU timer operations and task signal handling failures
- Deploy kernel tracing (ftrace/eBPF) to monitor run_posix_cpu_timers() and exit_notify() call patterns
- Implement runtime integrity monitoring to detect unexpected modifications to timer structures
- Use SentinelOne's behavioral AI engine to identify anomalous process termination patterns
Monitoring Recommendations
- Enable kernel auditing for process creation and termination events
- Configure crash dump collection to capture kernel state during any timer-related crashes
- Monitor for exploitation attempts using known PoC signatures from the GitHub repository
How to Mitigate CVE-2025-38352
Immediate Actions Required
- Apply the latest kernel patches from the Linux kernel stable branch immediately
- If patching is not immediately possible, enable CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y in kernel configuration and recompile
- Restrict local access to untrusted users on affected systems
- Monitor for exploitation attempts using the detection strategies outlined above
Patch Information
The Linux kernel maintainers have released patches across multiple stable branches. The fix adds a tsk->exit_state check into run_posix_cpu_timers() to prevent the race condition. The following patch commits address this vulnerability:
- Kernel Git Commit Fix
- Kernel Git Commit Security Fix
- Kernel Git Commit Bugfix
- Kernel Git Commit Enhancement
Debian users should apply updates from the Debian LTS security announcements.
Workarounds
- Enable CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y kernel configuration option as a mitigation when the task_work path is used
- Limit untrusted local user access to reduce the attack surface
- Implement process sandboxing using containers or namespaces to restrict timer operations
- Consider deploying grsecurity or similar kernel hardening patches if available for your kernel version
# Verify current kernel configuration for the workaround option
zcat /proc/config.gz | grep CONFIG_POSIX_CPU_TIMERS_TASK_WORK
# If not set, rebuild kernel with:
# CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
# Check current kernel version for patch status
uname -r
# Update kernel on Debian-based systems
apt update && apt upgrade linux-image-$(uname -r)
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


