CVE-2025-21786: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: workqueue: Put the pwq after detaching the rescuer from the pool The commit 68f83057b913("workqueue: Reap workers via kthread_stop() and remove detach_completion") adds code to reap the normal workers but mistakenly does not handle the rescuer and also removes the code waiting for the rescuer in put_unbound_pool(), which caused a use-after-free bug reported by Cheung Wall. To avoid the use-after-free bug, the pool’s reference must be held until the detachment is complete. Therefore, move the code that puts the pwq after detaching the rescuer from the pool.
AI Analysis
Technical Summary
CVE-2025-21786 is a high-severity use-after-free vulnerability in the Linux kernel's workqueue subsystem. The flaw arises from improper handling of the rescuer thread detachment from the workqueue pool. Specifically, a commit (68f83057b913) intended to improve worker thread cleanup by reaping normal workers via kthread_stop() inadvertently removed the code that waited for the rescuer thread to detach in put_unbound_pool(). This omission caused the pool's reference count to be decremented prematurely, leading to a use-after-free condition. The rescuer thread is a special worker responsible for handling deferred work in the kernel. If the pool's reference is released before the rescuer fully detaches, subsequent accesses to the freed memory can occur, potentially allowing attackers to execute arbitrary code, cause kernel crashes, or escalate privileges. The vulnerability is identified as CWE-416 (Use After Free). The CVSS v3.1 score is 7.8 (high), with vector AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, indicating local attack vector, low attack complexity, requires low privileges, no user interaction, unchanged scope, and high impact on confidentiality, integrity, and availability. No known exploits are currently reported in the wild. The fix involves reordering the code to ensure the pool's reference is held until the rescuer detaches, preventing premature freeing of resources.
Potential Impact
For European organizations relying on Linux-based systems—ranging from servers, embedded devices, to cloud infrastructure—this vulnerability poses a significant risk. Exploitation could allow local attackers or malicious processes with limited privileges to execute arbitrary code in kernel context, leading to full system compromise. This threatens confidentiality of sensitive data, integrity of system operations, and availability due to potential kernel panics or crashes. Critical infrastructure, financial institutions, and government agencies using Linux kernels with the affected commit are particularly at risk. The vulnerability's local attack vector means attackers need some level of access, but given the prevalence of multi-tenant environments and containerized deployments in Europe, lateral movement and privilege escalation risks are heightened. The absence of required user interaction facilitates automated exploitation once local access is gained. Although no exploits are known yet, the high impact and ease of exploitation make timely patching essential to prevent potential targeted attacks or ransomware campaigns leveraging this kernel flaw.
Mitigation Recommendations
European organizations should prioritize applying the official Linux kernel patches that reorder the workqueue pool reference handling to eliminate the use-after-free condition. Kernel versions containing the vulnerable commit (68f83057b913) must be identified and updated promptly. For environments where immediate patching is challenging, consider restricting local access to trusted users only, employing mandatory access controls (e.g., SELinux, AppArmor) to limit process capabilities, and monitoring kernel logs for anomalous behavior related to workqueue threads. Additionally, implement runtime integrity monitoring and leverage kernel hardening features such as Kernel Page Table Isolation (KPTI) and Control Flow Integrity (CFI) where available. Regularly audit and update container and virtualization platforms that rely on affected kernels. Finally, maintain robust incident response plans to detect and respond to potential exploitation attempts swiftly.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Poland, Sweden, Belgium, Finland
CVE-2025-21786: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: workqueue: Put the pwq after detaching the rescuer from the pool The commit 68f83057b913("workqueue: Reap workers via kthread_stop() and remove detach_completion") adds code to reap the normal workers but mistakenly does not handle the rescuer and also removes the code waiting for the rescuer in put_unbound_pool(), which caused a use-after-free bug reported by Cheung Wall. To avoid the use-after-free bug, the pool’s reference must be held until the detachment is complete. Therefore, move the code that puts the pwq after detaching the rescuer from the pool.
AI-Powered Analysis
Technical Analysis
CVE-2025-21786 is a high-severity use-after-free vulnerability in the Linux kernel's workqueue subsystem. The flaw arises from improper handling of the rescuer thread detachment from the workqueue pool. Specifically, a commit (68f83057b913) intended to improve worker thread cleanup by reaping normal workers via kthread_stop() inadvertently removed the code that waited for the rescuer thread to detach in put_unbound_pool(). This omission caused the pool's reference count to be decremented prematurely, leading to a use-after-free condition. The rescuer thread is a special worker responsible for handling deferred work in the kernel. If the pool's reference is released before the rescuer fully detaches, subsequent accesses to the freed memory can occur, potentially allowing attackers to execute arbitrary code, cause kernel crashes, or escalate privileges. The vulnerability is identified as CWE-416 (Use After Free). The CVSS v3.1 score is 7.8 (high), with vector AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, indicating local attack vector, low attack complexity, requires low privileges, no user interaction, unchanged scope, and high impact on confidentiality, integrity, and availability. No known exploits are currently reported in the wild. The fix involves reordering the code to ensure the pool's reference is held until the rescuer detaches, preventing premature freeing of resources.
Potential Impact
For European organizations relying on Linux-based systems—ranging from servers, embedded devices, to cloud infrastructure—this vulnerability poses a significant risk. Exploitation could allow local attackers or malicious processes with limited privileges to execute arbitrary code in kernel context, leading to full system compromise. This threatens confidentiality of sensitive data, integrity of system operations, and availability due to potential kernel panics or crashes. Critical infrastructure, financial institutions, and government agencies using Linux kernels with the affected commit are particularly at risk. The vulnerability's local attack vector means attackers need some level of access, but given the prevalence of multi-tenant environments and containerized deployments in Europe, lateral movement and privilege escalation risks are heightened. The absence of required user interaction facilitates automated exploitation once local access is gained. Although no exploits are known yet, the high impact and ease of exploitation make timely patching essential to prevent potential targeted attacks or ransomware campaigns leveraging this kernel flaw.
Mitigation Recommendations
European organizations should prioritize applying the official Linux kernel patches that reorder the workqueue pool reference handling to eliminate the use-after-free condition. Kernel versions containing the vulnerable commit (68f83057b913) must be identified and updated promptly. For environments where immediate patching is challenging, consider restricting local access to trusted users only, employing mandatory access controls (e.g., SELinux, AppArmor) to limit process capabilities, and monitoring kernel logs for anomalous behavior related to workqueue threads. Additionally, implement runtime integrity monitoring and leverage kernel hardening features such as Kernel Page Table Isolation (KPTI) and Control Flow Integrity (CFI) where available. Regularly audit and update container and virtualization platforms that rely on affected kernels. Finally, maintain robust incident response plans to detect and respond to potential exploitation attempts swiftly.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2024-12-29T08:45:45.765Z
- Cisa Enriched
- true
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 682d9832c4522896dcbe8801
Added to database: 5/21/2025, 9:09:06 AM
Last enriched: 7/3/2025, 4:40:32 AM
Last updated: 8/13/2025, 12:54:14 PM
Views: 13
Related Threats
Researcher to release exploit for full auth bypass on FortiWeb
HighCVE-2025-9091: Hard-coded Credentials in Tenda AC20
LowCVE-2025-9090: Command Injection in Tenda AC20
MediumCVE-2025-9092: CWE-400 Uncontrolled Resource Consumption in Legion of the Bouncy Castle Inc. Bouncy Castle for Java - BC-FJA 2.1.0
LowCVE-2025-9089: Stack-based Buffer Overflow in Tenda AC20
HighActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.