Skip to contentSkip to conversation

CVE-2026-74307: ext4: validate donor file superblock early in EXT4_IOC_MOVE_EXT

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Aug 15

lore
Share & tools
lore
#0 lore raw

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

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

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

ext4: validate donor file superblock early in EXT4_IOC_MOVE_EXT

Reject the EXT4_IOC_MOVE_EXT ioctl early if the donor file does not belong to the same superblock as the original file. Currently, this validation is performed inside ext4_move_extents() by mext_check_validity(), but only after lock_two_nondirectories() has already acquired the inode locks. When the donor fd refers to a file on a different filesystem (e.g., overlayfs), this late validation creates a circular lock dependency:

CPU0 (overlayfs write) CPU1 (ext4 ioctl)
---- ----
inode_lock(ovl_inode)
mnt_want_write_file(filp)
sb_start_write(ext4_sb) [sb_writers]
backing_file_write_iter()
vfs_iter_write(real_file)
file_start_write(real_file)
sb_start_write(ext4_sb) [blocked by freeze]
lock_two_nondirectories()
inode_lock(ovl_inode) [blocked]

With a concurrent freeze operation holding sb_writers write side, this forms a deadlock cycle: CPU0 waits for freeze to complete, freeze waits for CPU1's sb_writers reader to exit, CPU1 waits for CPU0's inode lock.

Since EXT4_IOC_MOVE_EXT exchanges physical extents between two files, it fundamentally requires both files to reside on the same ext4 filesystem. Moving the superblock check before any lock acquisition is both semantically correct and eliminates the circular dependency by ensuring that cross-filesystem donor fds are rejected before sb_writers or inode locks are taken.

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

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

	Issue introduced in 3.18 with commit fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a and fixed in 6.12.97 with commit 74796e886ca39fcb0d3fd36ea6a39c62784ab6fb
	Issue introduced in 3.18 with commit fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a and fixed in 7.1.5 with commit fb52013cad9e9b7d3a6a14ea1bcd841e41da7c6c
	Issue introduced in 3.18 with commit fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a and fixed in 7.2-rc1 with commit c143957520c6c9b5cd72e0de8b52b814f0c576fe

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

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/ext4/ioctl.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/74796e886ca39fcb0d3fd36ea6a39c62784ab6fb
	https://git.kernel.org/stable/c/fb52013cad9e9b7d3a6a14ea1bcd841e41da7c6c
	https://git.kernel.org/stable/c/c143957520c6c9b5cd72e0de8b52b814f0c576fe