CVE-2025-21893
Published: 31 March 2025
Description
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
Security Summary
CVE-2025-21893 is a use-after-free (UAF) vulnerability in the Linux kernel's keys subsystem, specifically within the key_put() function. The flaw occurs when a key's reference count drops to zero, after which the kernel's garbage collector thread may destroy the key at any time. However, key_put() accesses the key structure beyond this point in an attempt to accelerate quota reclamation, violating the constraint that it should not touch the key post-decrement except for the static global key_gc_work variable. This issue is classified under CWE-416 and carries a CVSS v3.1 base score of 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
A local attacker with low privileges can exploit this vulnerability without requiring user interaction. Exploitation involves manipulating key reference counts to trigger the UAF condition in key_put(), potentially leading to high-impact consequences such as unauthorized data access, memory corruption, arbitrary code execution, or denial of service through system instability.
Mitigation is addressed in the referenced stable kernel patches: commits 6afe2ea2daec156bd94ad2c5a6f4f4c48240dcd3, 75845c6c1a64483e9985302793dbf0dfa5f71e32, and f6a3cf833188e897c97028cd7b926e3f2cb1a8c0. These fixes introduce a flag to signal immediate garbage collection eligibility for the key, avoiding direct inspection of the reference count in the collector and preventing post-zero access in key_put(). Security practitioners should update to kernels incorporating these commits.
Details
- CWE(s)
Affected Products
MITRE ATT&CK Enterprise Techniques
Why these techniques?
Local use-after-free in Linux kernel keys subsystem enables arbitrary code execution/privilege escalation by low-privileged attacker, directly mapping to exploitation for privilege escalation.