Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F35D6314A63 for ; Wed, 24 Dec 2025 10:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766572527; cv=none; b=rpMUP07tQBi7yMsJXYahajvIOJ7rqfDrwaxcr6azwOEZY9Ot3HjyTKP6lsOGVpLPy+ootc3X8wFrM5csAQkiez+GmnCEcqh0d4FwUou4AnzgXManF8pIyYnk0JIrR6wY6YRJoXwx5M3yNZdTsm5OOroIRTFR53mkyhLnfXq10AM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766572527; c=relaxed/simple; bh=ApbppR/zmTxDb4De+jglbZeUo2jsn3LCjduOYgksic8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NxrWjcXio9yAr4ZrG2xpgoOghUykdZ/8a8eojbiH8133YXM7YSS2QtNToH0PC4qP93oWtdyveHWvBO+SUcoVXxUprlI/pg1lxLUqOlpd9eOuqC9/5CNrthW2o0rghPp5wRLnGgGi5OvsqI9DaHPNhgcrglexhDo9ZWnnSzXhOVE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=S3QVA5sg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="S3QVA5sg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44BBAC4CEFB; Wed, 24 Dec 2025 10:35:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1766572526; bh=ApbppR/zmTxDb4De+jglbZeUo2jsn3LCjduOYgksic8=; h=From:To:Cc:Subject:Date:Reply-To:From; b=S3QVA5sgfVP+7K1EJuFXqpAU+6j/sDzedbSzJSRbKVM+B/VnEfYutFfmy02L9eMH/ UEadRXecS09YGVwhJ27F0K3uEt53HObXNZwtVefoy6zRLKiZLNTDg7qfFypsA0bIhn o8COyh2uF+4F/MW/+urRotNHAeCGDghqL7h6sxpI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-68356: gfs2: Prevent recursive memory reclaim Date: Wed, 24 Dec 2025 11:35:01 +0100 Message-ID: <2025122456-CVE-2025-68356-1574@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3642; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=rAy87nXraTchHjGGnmnIzhjhMqVe6hGkJYwf3k75lIc=; b=owGbwMvMwCRo6H6F97bub03G02pJDJneBy/Mkd6w5Pza4y6T9xt8PePT68/qsHnpxVjH89o+d VvDzq1f0RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATWVrCsOBgR1XbQfMLifzX AlcZX7j9n6H5DgPD/NrY+9vjRZpn5B7Obg7u1izyOLPGEAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman 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