CVE-2026-98530 in Linuxinfo

Summary

by MITRE • 10/18/2026

In the Linux kernel, the following vulnerability has been resolved:

kprobes: Fix permanent hang when flushing the kprobe optimizer

Writing 0 to /proc/sys/debug/kprobes-optimization while a kprobe is jump-optimized never returns. The writer sleeps in D state forever with kprobe_sysctl_mutex held, so any later read or write of that sysctl hangs as well. For example, with vfs_read+9 as an optimizable address in this build:

# cd /sys/kernel/tracing # echo 'p:myprobe vfs_read+9' >> kprobe_events # echo 1 > events/kprobes/myprobe/enable # # wait until /sys/kernel/debug/kprobes/list shows [OPTIMIZED]
# echo 0 > /proc/sys/debug/kprobes-optimization

INFO: task sh:246 blocked for more than 10 seconds. Call Trace: <TASK> __schedule+0x1176/0x4f70 schedule+0xdc/0x2c0 schedule_timeout+0x17b/0x260 wait_for_completion+0x173/0x3c0 wait_for_kprobe_optimizer_locked+0xbc/0x130 proc_kprobes_optimization_handler+0x156/0x1b0 proc_sys_call_handler+0x324/0x490 vfs_write+0x52d/0xfe0 ksys_write+0xff/0x200 do_syscall_64+0x106/0x630 entry_SYSCALL_64_after_hwframe+0x77/0x7f </TASK> ... INFO: task cat:265 is blocked on a mutex likely owned by task sh:246.

wait_for_kprobe_optimizer_locked() reinitializes optimizer_completion, asks the optimizer thread to flush and sleeps in wait_for_completion(). The thread drains the (un)optimizing lists, but calls complete() only if completion_done() is true, i.e. if the completion is already done, which never happens while someone waits. disarm_all_kprobes() and kprobe_trace_self_tests_init() wait the same way.

Calling complete() unconditionally would not be enough: the waiter drops kprobe_mutex while it sleeps, and nothing else serializes the sysctl handler against the debugfs "enabled" file. A second flusher that still finds the lists non-empty, e.g. because a disabled probe is queued for unoptimizing, reinitializes the completion under the first:

sysctl write debugfs "enabled" write unoptimize_all_kprobes() wait_for_kprobe_optimizer_locked() init_completion(c) mutex_unlock(&kprobe_mutex) wait_for_completion(c) disarm_all_kprobes() wait_for_kprobe_optimizer_locked() init_completion(c) // c->wait is reset, the first // waiter is off the queue mutex_unlock(&kprobe_mutex) wait_for_completion(c) kprobe_optimizer() complete(c) // wakes the debugfs writer only

where c is &optimizer_completion. Lining up the two writes during an optimizer pass loses the sysctl writer this way.

Replace the completion with a counter of optimizer passes, bumped at the end of each pass and signalled with wake_up_var_locked(), both under kprobe_mutex. A flusher samples the count and waits with wait_var_event_mutex(), which drops kprobe_mutex only while sleeping, so a new count means a whole pass ran in the meantime. Nothing is reinitialized, so several flushers can sleep in the wait at once.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 10/18/2026

The Linux kernel contains a critical concurrency vulnerability within the kprobes subsystem that results in permanent system hangs when attempting to disable or modify probe optimization settings while active probes are being optimized. This flaw specifically manifests when an administrator writes zero to /proc/sys/debug/kprobes-optimization, triggering a flush of the kprobe optimizer. Under normal circumstances, this operation should safely dismantle jump optimizations for existing probes. However, due to improper synchronization mechanisms involving completion variables and mutexes, the writing process enters an uninterruptible sleep state indefinitely. This condition locks the kprobe_sysctl_mutex, which subsequently causes any subsequent read or write operations on that same sysctl entry to hang as well, effectively rendering a significant portion of kernel debugging infrastructure unresponsive until a system reboot occurs.

The technical root cause lies in the interaction between wait_for_k_probe_optimizer_locked and the underlying completion mechanism used to synchronize with the background optimizer thread. When a flush is requested, the function reinitializes an optimizer_completion variable and then sleeps waiting for that specific completion event. The issue arises because the condition under which complete() is called by the optimizer thread relies on completion_done(), which checks if the completion has already been signaled. If multiple threads attempt to trigger this flush simultaneously or in rapid succession, a race condition occurs where one writer reinitializes the completion variable while another is waiting. This action removes the first waiter from the wait queue without signaling it, causing that initial process to sleep forever because its specific wake-up signal was effectively discarded by the second initialization event.

This vulnerability aligns with CWE-362, Concurrent Execution using Shared Resource with Improper Synchronization, specifically illustrating a race condition in shared resource management where state reinitialization invalidates pending waiters. From an ATT&CK perspective, this defect impacts system availability and integrity within the Defense Evasion or Impact tactics by allowing local users to cause denial of service through simple sysctl manipulations. The lack of proper serialization between the sysctl handler and debugfs operations exacerbates the issue, as concurrent modifications can easily trigger the flawed logic path that leads to the permanent hang state described in kernel logs showing tasks blocked for extended periods with mutexes held.

To mitigate this vulnerability, the Linux kernel developers replaced the fragile completion variable mechanism with a more robust counter-based synchronization approach. The new implementation utilizes an optimizer pass count that is incremented at the end of each optimization cycle and signaled using wake_up_var_locked under the protection of kprobe_mutex. Flushers now sample this counter and wait using wait_var_event_mutex, which ensures that they drop the mutex only while sleeping rather than holding it throughout the wait period. This design allows multiple flush requests to coexist safely without interfering with one another's state expectations, as there is no reinitialization of shared synchronization primitives during the wait phase. Administrators should ensure their systems are updated with kernel patches addressing this kprobes optimization flaw to maintain stability in environments relying heavily on dynamic tracing and performance monitoring tools.

Responsible

Linux

Reservation

09/25/2026

Disclosure

10/18/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!