CVE-2025-68356
gfs2: Prevent recursive memory reclaim
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.
INFO
Published Date :
Dec. 24, 2025, 11:15 a.m.
Last Modified :
Oct. 21, 2026, 1:18 p.m.
Remotely Exploit :
No
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Solution
- Modify gfp_mask to exclude __GFP_FS flag.
- Ensure address spaces do not include __GFP_FS.
- Update Linux kernel to apply the fix.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2025-68356.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2025-68356 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2025-68356
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2025-68356 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2025-68356 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 21, 2026
Action Type Old Value New Value Added Affected Affected value modified. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2025/68xxx/CVE-2025-68356.json">CVE-2025-68356</a> Added Reference https://git.kernel.org/stable/c/2c5f4a53476e3cab70adc77b38942c066bd2c17c Added Reference https://git.kernel.org/stable/c/49e7347f4644d031306d56cb4d51e467cbdcbc69 Added Reference https://git.kernel.org/stable/c/66eb53cecc5f83183535bbfb2fa6464322049b61 Added Reference https://git.kernel.org/stable/c/9c0960ed112398bdb6c60ccf6e6b583bc59acede Added Reference https://git.kernel.org/stable/c/edb2b255618621dc83d0ec23150e16b2c697077f Removed Reference https://git.kernel.org/stable/c/2c5f4a53476e3cab70adc77b38942c066bd2c17c Removed Reference https://git.kernel.org/stable/c/49e7347f4644d031306d56cb4d51e467cbdcbc69 Removed Reference https://git.kernel.org/stable/c/9c0960ed112398bdb6c60ccf6e6b583bc59acede Removed Reference https://git.kernel.org/stable/c/edb2b255618621dc83d0ec23150e16b2c697077f -
CVE Translated by [email protected]
Oct. 13, 2026
Action Type Old Value New Value Added Translation Title: Linux, Description: En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: gfs2: Prevenir la recuperación de memoria recursiva La función new_inode() devuelve un nuevo inodo con inode -> i_mapping -> gfp_mask establecido en GFP_HIGHUSER_MOVABLE. Este valor incluye la bandera __GFP_FS, por lo que las asignaciones en ese espacio de direcciones pueden recursar en la recuperación de memoria del sistema de archivos. No queremos que eso suceda porque puede consumir una cantidad significativa de memoria de pila. Peor aún es que también puede provocar un interbloqueo: por ejemplo, en varios lugares, se llama a gfs2_unstuff_dinode() dentro de transacciones del sistema de archivos. Esto llama a filemap_grab_folio(), que puede asignar un nuevo folio, lo que puede desencadenar la recuperación de memoria. Si la recuperación de memoria recursa en el sistema de archivos y comienza otra transacción, se producirá un interbloqueo. Para solucionar este tipo de problemas, se evita que la recuperación de memoria recurse en el código del sistema de archivos asegurándose de que el gfp_mask de los espacios de direcciones de inodos no incluya __GFP_FS. Los espacios de direcciones de 'meta' y de grupo de recursos ya estaban usando GFP_NOFS como su gfp_mask (que no incluye __GFP_FS). El valor predeterminado de GFP_HIGHUSER_MOVABLE es menos restrictivo que GFP_NOFS, sin embargo. Para evitar ser excesivamente restrictivo, se usa el valor predeterminado y solo se elimina la bandera __GFP_FS. No estoy seguro de si esto realmente marcará una diferencia, pero tampoco debería perjudicar. Este parche se basa libremente en el commit ad22c7a043c2 ('xfs: prevenir desbordamientos de pila por asignación de caché de página'). Soluciona xfstest generic/273. -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jun. 17, 2026
Action Type Old Value New Value Added Affected [{'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': 'dc0b9435238c1a68150c798c9c7a1b5d7414cbb9', 'lessThan': 'edb2b255618621dc83d0ec23150e16b2c697077f', 'versionType': 'git'}, {'status': 'affected', 'version': 'dc0b9435238c1a68150c798c9c7a1b5d7414cbb9', 'lessThan': '9c0960ed112398bdb6c60ccf6e6b583bc59acede', 'versionType': 'git'}, {'status': 'affected', 'version': 'dc0b9435238c1a68150c798c9c7a1b5d7414cbb9', 'lessThan': '49e7347f4644d031306d56cb4d51e467cbdcbc69', 'versionType': 'git'}, {'status': 'affected', 'version': 'dc0b9435238c1a68150c798c9c7a1b5d7414cbb9', 'lessThan': '2c5f4a53476e3cab70adc77b38942c066bd2c17c', 'versionType': 'git'}], 'programFiles': ['fs/gfs2/glock.c', 'fs/gfs2/inode.c', 'fs/gfs2/inode.h', 'fs/gfs2/ops_fstype.c'], 'defaultStatus': 'unaffected'}, {'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '6.6'}, {'status': 'unaffected', 'version': '0', 'lessThan': '6.6', 'versionType': 'semver'}, {'status': 'unaffected', 'version': '6.12.63', 'versionType': 'semver', 'lessThanOrEqual': '6.12.*'}, {'status': 'unaffected', 'version': '6.17.13', 'versionType': 'semver', 'lessThanOrEqual': '6.17.*'}, {'status': 'unaffected', 'version': '6.18.2', 'versionType': 'semver', 'lessThanOrEqual': '6.18.*'}, {'status': 'unaffected', 'version': '6.19', 'versionType': 'original_commit_for_fix', 'lessThanOrEqual': '*'}], 'programFiles': ['fs/gfs2/glock.c', 'fs/gfs2/inode.c', 'fs/gfs2/inode.h', 'fs/gfs2/ops_fstype.c'], 'defaultStatus': 'affected'}] -
New CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Dec. 24, 2025
Action Type Old Value New Value Added 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. Added Reference https://git.kernel.org/stable/c/2c5f4a53476e3cab70adc77b38942c066bd2c17c Added Reference https://git.kernel.org/stable/c/49e7347f4644d031306d56cb4d51e467cbdcbc69 Added Reference https://git.kernel.org/stable/c/9c0960ed112398bdb6c60ccf6e6b583bc59acede Added Reference https://git.kernel.org/stable/c/edb2b255618621dc83d0ec23150e16b2c697077f