CVE-2026-99942: posix-cpu-timers: Fix pid refcount leak in do_cpu_nanosleep() signal path
In the Linux kernel, the following vulnerability has been resolved:
posix-cpu-timers: Fix pid refcount leak in docpunanosleep() signal path
docpunanosleep() sleeps on a temporary kitimer whose reference on the target's struct pid is taken by posixcputimercreate() and dropped by posixcputimerdel(). When a signal ends the sleep, the timer is disarmed with posixcputimerset(), but posixcputimerdel() is only called for a result of 0 or TIMERRETRY. If the target thread or process has exited in the meantime, timerlocksighand() finds no task, posixcputimerset() returns -ESRCH and the pid reference is leaked.
An unprivileged user can trigger this: sleep on the CPU clock of a thread, let that thread exit, then signal the sleeper. Each round leaks one struct pid. Repeating it exhausts unreclaimable slab memory within minutes:
Out of memory: Killed process 150 (poc) total-vm:789292kB, anon-rss:484kB Kernel panic - not syncing: System is deadlocked on memory
Fix this by also calling posixcputimerdel() on -ESRCH. With the target gone, the deletion is safe. It finds no task either and only drops the pid reference.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In do_cpu_nanosleep()'s signal path, also call posix_cpu_timer_del() when posix_cpu_timer_set() returns -ESRCH.
Event History
Frequently Asked Questions
Who can exploit this issue?
An unprivileged local user can trigger the leak. The described sequence requires sleeping on the CPU clock of a target thread, allowing that thread to exit, and then signaling the sleeping thread.
What is the practical impact of repeated exploitation?
Each successful round leaks one struct pid reference. Repeating the sequence can exhaust unreclaimable slab memory within minutes, leading to out-of-memory handling and potentially a kernel panic.
What condition causes the reference leak?
The leak occurs when the target thread or process exits while the CPU-clock sleep is active and a signal ends that sleep. In that case, posix_cpu_timer_set() returns -ESRCH, but the affected logic did not call posix_cpu_timer_del() to drop the pid reference.
What does the fix change?
The fix calls posix_cpu_timer_del() when posix_cpu_timer_set() returns -ESRCH. Because the target is already gone, deletion safely finds no task and drops the retained pid reference.