CVE-2026-64356: xfs: fix memory leak in xfs_dqinode_metadir_create()

Greg Kroah-Hartman <[email protected]> Sat, 25 Jul 2026 10:49:33 +0200
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026072519-CVE-2026-64356-d9e2@gregkh>
From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

xfs: fix memory leak in xfs_dqinode_metadir_create()

If xfs_metadir_create() fails in xfs_dqinode_metadir_create(), the current
code returns directly, leaking the allocated update and transaction state.
If the subsequent commit fails, the caller-owned inode reference is left
behind.

Fix this memory leak by routing the create failure path through
xfs_metadir_cancel().  For both create and commit failures, finish and
release any inode returned to the caller, mirroring the unwind pattern in
xfs_metadir_mkdir().

The bug was first flagged by an experimental analysis tool we are
developing for kernel memory-management bugs while analyzing
v6.13-rc1. The tool is still under development and is not yet publicly
available. Manual inspection confirms that the bug is still
present in v7.1.1.

An x86_64 allyesconfig build showed no new warnings. Runtime validation
used kprobe fault injection during `mount -o uquota` on a metadir XFS
image. Injecting xfs_metadir_create() reproduced the old active-update path
that left mount stuck later in mount setup; after this change, the same
injection reported cancel_hits=1 and irele_hits=1. Injecting
xfs_metadir_commit() exercised the old inode-reference leak path; after
this change, it reported irele_hits=1.

The Linux kernel CVE team has assigned CVE-2026-64356 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 6.13 with commit e80fbe1ad8eff7d7d1363e14f1e493d84dd37c84 and fixed in 6.18.39 with commit c3d3d2212c2966973dd7d603c6c6e6ed6fc7fbe1
	Issue introduced in 6.13 with commit e80fbe1ad8eff7d7d1363e14f1e493d84dd37c84 and fixed in 7.1.4 with commit 06a2e6dbaa26c0740ac76dfa66b0aedc78d05820
	Issue introduced in 6.13 with commit e80fbe1ad8eff7d7d1363e14f1e493d84dd37c84 and fixed in 7.2-rc2 with commit 45de375b25060edf46e20abb36521ba530336ceb

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-2026-64356
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/xfs/libxfs/xfs_dquot_buf.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/c3d3d2212c2966973dd7d603c6c6e6ed6fc7fbe1
	https://git.kernel.org/stable/c/06a2e6dbaa26c0740ac76dfa66b0aedc78d05820
	https://git.kernel.org/stable/c/45de375b25060edf46e20abb36521ba530336ceb