CVE-2026-90066: samples/ftrace: Fix kthread_stop() on ERR_PTR in ftrace-direct-multi-modify
In the Linux kernel, the following vulnerability has been resolved:
samples/ftrace: Fix kthreadstop() on ERRPTR in ftrace-direct-multi-modify
ftracedirectmultiinit() assigns kthreadrun()'s return value to simpletsk without an ISERR() check. When kthreadrun() fails it returns ERRPTR(-ENOMEM), but init still returns 0, so the module loads with simpletsk holding an error pointer. On unload, ftracedirectmultiexit() then passes that ERRPTR to kthreadstop(), leading to a null-pointer-dereference.
Check the return value of kthreadrun() with ISERR(); on failure, unregister the ftrace direct call and propagate the error code.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.6.157.1-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.111-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.2.6-1 - Upgrade
Upgrade
debian/linux-6.12to a version that resolves this vulnerability.Fixed in 6.12.111-1~deb12u1 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.191 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.157 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.110 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.52 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.2.6 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1 - Upgrade
Upgrade
debian/linux-6.12to a version that resolves this vulnerability.Fixed in 6.12.113-1~deb12u1 - Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Compensating control
In samples/ftrace ftrace_direct_multi_init(), check the return value of kthread_run() with IS_ERR(); if it fails, unregister the ftrace direct call and propagate the error code instead of returning success.
Event History
Frequently Asked Questions
What condition is required to trigger the fault?
The module's kthread_run() call must fail, returning an ERR_PTR such as ERR_PTR(-ENOMEM). The fault is then triggered when the module is unloaded and its exit path passes that error pointer to kthread_stop().
What is the practical impact of the affected error path?
The unload operation can cause a null-pointer dereference. The issue is tied to the samples/ftrace ftrace-direct-multi-modify module and its thread-creation failure path.
How does the fix change behavior when thread creation fails?
The corrected code checks the kthread_run() result with IS_ERR(). On failure, it unregisters the ftrace direct call and returns the error instead of allowing the module to load with an invalid task pointer.