CVE-2025-68356

Description

In the Linux kernel, the following vulnerability has been resolved:gfs2: Prevent recursive memory reclaimFunction new_inode() returns a new inode with inode->i_mapping->gfp_maskset to GFP_HIGHUSER_MOVABLE. This value includes the __GFP_FS flag, soallocations in that address space can recurse into filesystem memoryreclaim. We dont want that to happen because it can consume asignificant amount of stack memory.Worse than that is that it can also deadlock: for example, in severalplaces, gfs2_unstuff_dinode() is called inside filesystem transactions.This calls filemap_grab_folio(), which can allocate a new folio, whichcan trigger memory reclaim. If memory reclaim recurses into thefilesystem and starts another transaction, a deadlock will ensue.To fix these kinds of problems, prevent memory reclaim from recursinginto filesystem code by making sure that the gfp_mask of inode addressspaces doesnt include __GFP_FS.The meta and resource group address spaces were already using GFP_NOFSas their gfp_mask (which doesnt include __GFP_FS). The default valueof GFP_HIGHUSER_MOVABLE is less restrictive than GFP_NOFS, though. Toavoid being overly limiting, use the default value and only knock offthe __GFP_FS flag. Im not sure if this will actually make adifference, but it also shouldnt hurt.This patch is loosely based on commit ad22c7a043c2 (xfs: prevent stackoverflows from page cache allocation).Fixes xfstest generic/273.

Risk Information

Base Score
5.5
MODERATE
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
EPSS Score
Exploitation Probability
0.026

Associated Vulnerability

No records found

Patch Details

No records found

References

https://nvd.nist.gov/vuln/detail/CVE-2023-1234
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-1234