CVE-2025-21786
Published: 27 February 2025
Summary
CVE-2025-21786 is a high-severity Use After Free (CWE-416) vulnerability in Linux Linux Kernel. Its CVSS base score is 7.8 (High).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked at the 2.2th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.
The strongest mitigations our analysis identified are NIST 800-53 SI-2 (Flaw Remediation) and RA-5 (Vulnerability Monitoring and Scanning).
Deeper analysis
CVE-2025-21786 is a use-after-free vulnerability (CWE-416) in the Linux kernel's workqueue subsystem. The issue arises from commit 68f83057b913 ("workqueue: Reap workers via kthread_stop() and remove detach_completion"), which added code to reap normal workers but incorrectly omitted handling for the rescuer worker and removed the wait for it in put_unbound_pool(). This results in the pool's reference not being held until rescuer detachment completes, triggering the use-after-free as reported by Cheung Wall.
The vulnerability has a CVSS 3.1 base score of 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H), indicating it can be exploited by a local attacker with low privileges and no user interaction. Successful exploitation could allow the attacker to achieve high impacts on confidentiality, integrity, and availability, such as arbitrary kernel code execution or system denial of service.
Mitigation requires applying upstream stable kernel patches, including those in commits 835b69c868f53f959d4986bbecd561ba6f38e492, e76946110137703c16423baf6ee177b751a34b7e, and e7c16028a424dd35be1064a68fa318be4359310f. These patches resolve the issue by moving the pwq put operation after fully detaching the rescuer from the pool.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2025-5141
Vulnerability details
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…
more
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.
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise TechniquesAI
Why these techniques?
The use-after-free in Linux kernel workqueue allows local low-privileged attackers to achieve arbitrary kernel code execution or DoS, directly enabling T1068 Exploitation for Privilege Escalation.
CVEs Like This One
Affected Assets
Mitigating Controls
Mitigating Controls (NIST 800-53 r5) AI
Directly requires timely patching of the Linux kernel to remediate the use-after-free vulnerability in the workqueue rescuer detachment.
Vulnerability scanning identifies Linux kernel versions affected by CVE-2025-21786, enabling targeted remediation.
Memory protection mechanisms mitigate exploitation of the kernel use-after-free by preventing unauthorized memory access or execution.