CVE-2025-68356
Unknown Unknown - Not Provided
Recursive Memory Reclaim Vulnerability in Linux GFS2 Causes Deadlock

Publication date: 2025-12-24

Last updated on: 2025-12-24

Assigner: kernel.org

Description
In the Linux kernel, the following vulnerability has been resolved: gfs2: Prevent recursive memory reclaim Function new_inode() returns a new inode with inode->i_mapping->gfp_mask set to GFP_HIGHUSER_MOVABLE. This value includes the __GFP_FS flag, so allocations in that address space can recurse into filesystem memory reclaim. We don't want that to happen because it can consume a significant amount of stack memory. Worse than that is that it can also deadlock: for example, in several places, gfs2_unstuff_dinode() is called inside filesystem transactions. This calls filemap_grab_folio(), which can allocate a new folio, which can trigger memory reclaim. If memory reclaim recurses into the filesystem and starts another transaction, a deadlock will ensue. To fix these kinds of problems, prevent memory reclaim from recursing into filesystem code by making sure that the gfp_mask of inode address spaces doesn't include __GFP_FS. The "meta" and resource group address spaces were already using GFP_NOFS as their gfp_mask (which doesn't include __GFP_FS). The default value of GFP_HIGHUSER_MOVABLE is less restrictive than GFP_NOFS, though. To avoid being overly limiting, use the default value and only knock off the __GFP_FS flag. I'm not sure if this will actually make a difference, but it also shouldn't hurt. This patch is loosely based on commit ad22c7a043c2 ("xfs: prevent stack overflows from page cache allocation"). Fixes xfstest generic/273.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-12-24
Last Modified
2025-12-24
Generated
2026-05-07
AI Q&A
2025-12-24
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
linux linux_kernel *
linux kernel *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability in the Linux kernel's gfs2 filesystem involves recursive memory reclaim caused by the gfp_mask flag GFP_HIGHUSER_MOVABLE including the __GFP_FS flag. This allows memory allocations to recurse into filesystem memory reclaim, which can consume significant stack memory and potentially cause deadlocks during filesystem transactions. The issue arises when functions like gfs2_unstuff_dinode() trigger memory reclaim that recurses into the filesystem, starting another transaction and causing a deadlock. The fix prevents memory reclaim from recursing into filesystem code by removing the __GFP_FS flag from the gfp_mask of inode address spaces.


How can this vulnerability impact me? :

This vulnerability can lead to significant stack memory consumption and deadlocks within the filesystem during memory allocation and reclaim operations. Such deadlocks can cause system hangs or crashes, impacting system stability and availability.


What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability, update your Linux kernel to a version that includes the patch preventing recursive memory reclaim in gfs2. This patch modifies the gfp_mask of inode address spaces to exclude the __GFP_FS flag, preventing deadlocks and excessive stack memory consumption. Applying the official kernel update or patch that fixes this issue is the recommended immediate step.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart