VYPR
Unrated severityNVD Advisory· Published Dec 4, 2025· Updated Apr 15, 2026

CVE-2025-40242

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

2

Patches

3

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.