Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 784A921FF25 for ; Sun, 18 Oct 2026 15:27:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792337257; cv=none; b=T6IEOR5kly/oZz8OWaMBCTZgFCvXroz4fXi5eKI7K1zMf7aKLbpgUD2P+yW3NKH6GrbENry4loYjGddA5An8dkHptSSw9CwLtHSOgIDHe6b/go0vshAlxRHWFY86EXr72AghzgqazfvYFp2lOFmNjBkmCzD4rmUb3nSD3cM1Ru4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792337257; c=relaxed/simple; bh=2i46x66JeWW39ca5KOMDTddGvrIRgHOHLYVpH2eWBUA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=L12Di9k86do5xMsRhJE5Tayg4e7BsNfTbUHI92lXeIc4vDtxSZJjKsE2Tylnq61OG7LFAtJDF9wm7uG1eRuK1qk8mZ3I6NooJxDeClTBOO2Dx/jL+ocuMQ1WxIK0qgIR7aj+mXV3mPh0YVNUVZqz0Ta4RdghDLthqu5JqIC9Oa0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QI4l4ZdC; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QI4l4ZdC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 407C61F000C5; Sun, 18 Oct 2026 15:27:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792337253; bh=zgq2VtiurXp8qP2VaoDLz1nCJqqwR+poZv3Nh9/XYhQ=; h=From:To:Cc:Subject:Date:Reply-To; b=QI4l4ZdCsOQGRp1ckCaAEl03sF+GJZWSqHN06IdKCBz947XU/rNeJ/QEvC5xAY0Jc 69llEzKWrpB5otptqOKgzCoOySIS+JLBUIi172PvAyotZbVoOEptNqU7hiIByw+vES 3H0oG8xzcGmzBDrTwSmK1UUf3jReJ2H4AvgHUv9Y= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-98530: kprobes: Fix permanent hang when flushing the kprobe optimizer Date: Sun, 18 Oct 2026 17:16:34 +0200 Message-ID: <2026101824-CVE-2026-98530-5922@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4920; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=LfHqYNcHtZ2DI6nvJdqVGaBsh6Nkhae/IF/IAtKAYxs=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlXHvXMuPvxaN392u03f8y9u/+1+eYGr5i0spAVr95pP ioOeXeBoSOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmEqzEML9AJuKC7bc7wRs7 NJszNY4uML216jvDPLWylEazOdp5rOe1331u636XdP8qPwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== 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: __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 ... 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. The Linux kernel CVE team has assigned CVE-2026-98530 to this issue. Affected and fixed versions =========================== Issue introduced in 7.0 with commit 73c12f209462d1712c5f55f3021a1b65b2e084c3 and fixed in 7.2.9 with commit f05a01fc7d4f731b4c100d2aef1e85ad77728862 Issue introduced in 7.0 with commit 73c12f209462d1712c5f55f3021a1b65b2e084c3 and fixed in 7.3-rc5 with commit 5bfa9f1a9dcb6ecb607adbc1c0226605c972935b Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-98530 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: kernel/kprobes.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/f05a01fc7d4f731b4c100d2aef1e85ad77728862 https://git.kernel.org/stable/c/5bfa9f1a9dcb6ecb607adbc1c0226605c972935b