CVE-2025-68356
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
24/12/2025
Last modified:
29/12/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
gfs2: Prevent recursive memory reclaim<br />
<br />
Function new_inode() returns a new inode with inode->i_mapping->gfp_mask<br />
set to GFP_HIGHUSER_MOVABLE. This value includes the __GFP_FS flag, so<br />
allocations in that address space can recurse into filesystem memory<br />
reclaim. We don&#39;t want that to happen because it can consume a<br />
significant amount of stack memory.<br />
<br />
Worse than that is that it can also deadlock: for example, in several<br />
places, gfs2_unstuff_dinode() is called inside filesystem transactions.<br />
This calls filemap_grab_folio(), which can allocate a new folio, which<br />
can trigger memory reclaim. If memory reclaim recurses into the<br />
filesystem and starts another transaction, a deadlock will ensue.<br />
<br />
To fix these kinds of problems, prevent memory reclaim from recursing<br />
into filesystem code by making sure that the gfp_mask of inode address<br />
spaces doesn&#39;t include __GFP_FS.<br />
<br />
The "meta" and resource group address spaces were already using GFP_NOFS<br />
as their gfp_mask (which doesn&#39;t include __GFP_FS). The default value<br />
of GFP_HIGHUSER_MOVABLE is less restrictive than GFP_NOFS, though. To<br />
avoid being overly limiting, use the default value and only knock off<br />
the __GFP_FS flag. I&#39;m not sure if this will actually make a<br />
difference, but it also shouldn&#39;t hurt.<br />
<br />
This patch is loosely based on commit ad22c7a043c2 ("xfs: prevent stack<br />
overflows from page cache allocation").<br />
<br />
Fixes xfstest generic/273.



