Skip to contentSkip to conversation

CVE-2026-31577: nilfs2: fix NULL i_assoc_inode dereference in nilfs_mdt_save_to_shadow_map

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 24

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

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

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

nilfs2: fix NULL i_assoc_inode dereference in nilfs_mdt_save_to_shadow_map

The DAT inode's btree node cache (i_assoc_inode) is initialized lazily during btree operations. However, nilfs_mdt_save_to_shadow_map() assumes i_assoc_inode is already initialized when copying dirty pages to the shadow map during GC.

If NILFS_IOCTL_CLEAN_SEGMENTS is called immediately after mount before any btree operation has occurred on the DAT inode, i_assoc_inode is NULL leading to a general protection fault.

Fix this by calling nilfs_attach_btree_node_cache() on the DAT inode in nilfs_dat_read() at mount time, ensuring i_assoc_inode is always initialized before any GC operation can use it.

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

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

	Fixed in 6.12.83 with commit 449ec5fc99f45974525ba9eea16b6670c45cd363
	Fixed in 6.18.24 with commit c36e206f302f1ddefed92d09ecbba070e1ae079e
	Fixed in 6.19.14 with commit 41de342278ae025c99cc8d33648773f05e306cf1
	Fixed in 7.0.1 with commit 97fb7afec404912d967a7d4715f37742666b3084

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-31577

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/nilfs2/dat.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/449ec5fc99f45974525ba9eea16b6670c45cd363
	https://git.kernel.org/stable/c/c36e206f302f1ddefed92d09ecbba070e1ae079e
	https://git.kernel.org/stable/c/41de342278ae025c99cc8d33648773f05e306cf1
	https://git.kernel.org/stable/c/97fb7afec404912d967a7d4715f37742666b3084
	https://git.kernel.org/stable/c/4a4e0328edd9e9755843787d28f16dd4165f8b48