[<prev] [next>] [day] [month] [year] [list]
Message-ID: <2025122456-CVE-2025-68356-1574@gregkh>
Date: Wed, 24 Dec 2025 11:35:01 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-cve-announce@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...nel.org>
Subject: CVE-2025-68356: gfs2: Prevent recursive memory reclaim
From: Greg Kroah-Hartman <gregkh@...nel.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.
The Linux kernel CVE team has assigned CVE-2025-68356 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.6 with commit dc0b9435238c1a68150c798c9c7a1b5d7414cbb9 and fixed in 6.12.63 with commit edb2b255618621dc83d0ec23150e16b2c697077f
Issue introduced in 6.6 with commit dc0b9435238c1a68150c798c9c7a1b5d7414cbb9 and fixed in 6.17.13 with commit 9c0960ed112398bdb6c60ccf6e6b583bc59acede
Issue introduced in 6.6 with commit dc0b9435238c1a68150c798c9c7a1b5d7414cbb9 and fixed in 6.18.2 with commit 49e7347f4644d031306d56cb4d51e467cbdcbc69
Issue introduced in 6.6 with commit dc0b9435238c1a68150c798c9c7a1b5d7414cbb9 and fixed in 6.19-rc1 with commit 2c5f4a53476e3cab70adc77b38942c066bd2c17c
Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to
older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2025-68356
will be updated if fixes are backported, please check that for the most
up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/gfs2/glock.c
fs/gfs2/inode.c
fs/gfs2/inode.h
fs/gfs2/ops_fstype.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes. Individual
changes are never tested alone, but rather are part of a larger kernel
release. Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all. If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
https://git.kernel.org/stable/c/edb2b255618621dc83d0ec23150e16b2c697077f
https://git.kernel.org/stable/c/9c0960ed112398bdb6c60ccf6e6b583bc59acede
https://git.kernel.org/stable/c/49e7347f4644d031306d56cb4d51e467cbdcbc69
https://git.kernel.org/stable/c/2c5f4a53476e3cab70adc77b38942c066bd2c17c
Powered by blists - more mailing lists