CVE-2025-40242
Description
In the Linux kernel, the following vulnerability has been resolved:
gfs2: Fix unlikely race in gdlm_put_lock
In gdlm_put_lock(), there is a small window of time in which the DFL_UNMOUNT flag has been set but the lockspace hasn't been released, yet. In that window, dlm may still call gdlm_ast() and gdlm_bast(). To prevent it from dereferencing freed glock objects, only free the glock if the lockspace has actually been released.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A race condition in gfs2's gdlm_put_lock can cause a use-after-free of glock objects when DLM callbacks arrive after the DFL_UNMOUNT flag is set but before the lockspace is released.
In the Linux kernel's GFS2 filesystem, function gdlm_put_lock() contains a small race window. After the DFL_UNMOUNT flag is set, the lockspace may not have been released yet. During that window, DLM can still invoke gdlm_ast() and gdlm_bast() callbacks that attempt to dereference glock objects that have already been freed, leading to a use-after-free condition [1][2].
The vulnerability is triggered during unmount. The prerequisite is that the system must be performing a GFS2 unmount operation while DLM callbacks are still pending for locks being released. No special authentication is required beyond local access capable of mounting and unmounting a GFS2 filesystem [1].
An attacker who can trigger the race may cause a crash (denial of service) or potentially exploit the use-after-free to achieve arbitrary code execution in kernel context, depending on memory layout and heap manipulation [1].
The fix, already applied to the stable kernel tree, ensures that glocks are only freed after the lockspace has actually been released, thus preventing the callbacks from accessing freed memory [1][2].
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
3279bde3bbb0a64c61b4ac64528c4d9bc0708Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- git.kernel.org/stable/c/279bde3bbb0ac0bad5c729dfa85983d75a5d7641nvd
- git.kernel.org/stable/c/28c4d9bc0708956c1a736a9e49fee71b65deee81nvd
- git.kernel.org/stable/c/4913592a3358f6ec366b8346b733d5e2360b08e1nvd
- git.kernel.org/stable/c/5fdc1474e678eea1700aa266c0b7c2c96f81dd0dnvd
- git.kernel.org/stable/c/64c61b4ac645222fa7b724cef616c1f862a72a40nvd
News mentions
0No linked articles in our index yet.