Skip to contentSkip to conversation

CVE-2025-71292: jfs: nlink overflow in jfs_rename

DISCUSSION Greg Kroah-Hartman 1 participant 1 message May 6

lore
Share & tools
lore
#0 lore raw

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

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

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

jfs: nlink overflow in jfs_rename

If nlink is maximal for a directory (-1) and inside that directory you perform a rename for some child directory (not moving from the parent), then the nlink of the first directory is first incremented and later decremented. Normally this is fine, but when nlink = -1 this causes a wrap around to 0, and then drop_nlink issues a warning.

After applying the patch syzbot no longer issues any warnings. I also ran some basic fs tests to look for any regressions.

The Linux kernel CVE team has assigned CVE-2025-71292 to this issue.

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

	Fixed in 5.10.252 with commit 2108829a59f081e822fdab8c2cd7131deb8aa8a1
	Fixed in 5.15.202 with commit b4330a0d0947fbdc9d445cbbeabd8cc910a8c9ca
	Fixed in 6.1.165 with commit a3d66089e50a6e0142f8884471f74292102ea9aa
	Fixed in 6.6.128 with commit f70fcbc2ac7c24f087a2c895c5753aa730b1e479
	Fixed in 6.12.75 with commit 5d77c36cd4b698649f5c30c5f6c084f4f61d1880
	Fixed in 6.18.16 with commit fe136426e30ca6debcf916fd6a141555ed9fde74
	Fixed in 6.19.6 with commit 93c325746ae59709b4f9bad4e3e4761c8d566c70
	Fixed in 7.0 with commit 9218dc26fd922b09858ecd3666ed57dfd8098da8

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

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/jfs/namei.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/2108829a59f081e822fdab8c2cd7131deb8aa8a1
	https://git.kernel.org/stable/c/b4330a0d0947fbdc9d445cbbeabd8cc910a8c9ca
	https://git.kernel.org/stable/c/a3d66089e50a6e0142f8884471f74292102ea9aa
	https://git.kernel.org/stable/c/f70fcbc2ac7c24f087a2c895c5753aa730b1e479
	https://git.kernel.org/stable/c/5d77c36cd4b698649f5c30c5f6c084f4f61d1880
	https://git.kernel.org/stable/c/fe136426e30ca6debcf916fd6a141555ed9fde74
	https://git.kernel.org/stable/c/93c325746ae59709b4f9bad4e3e4761c8d566c70
	https://git.kernel.org/stable/c/9218dc26fd922b09858ecd3666ed57dfd8098da8