CVE-2026-45915: fat: avoid parent link count underflow in rmdir
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
fat: avoid parent link count underflow in rmdir
Corrupted FAT images can leave a directory inode with an incorrect i_nlink (e.g. 2 even though subdirectories exist). rmdir then unconditionally calls drop_nlink(dir) and can drive i_nlink to 0, triggering the WARN_ON in drop_nlink().
Add a sanity check in vfat_rmdir() and msdos_rmdir(): only drop the parent link count when it is at least 3, otherwise report a filesystem error.
The Linux kernel CVE team has assigned CVE-2026-45915 to this issue.
Affected and fixed versions
===========================
Issue introduced in 2.6.19 with commit 9a53c3a783c2fa9b969628e65695c11c3e51e673 and fixed in 5.10.252 with commit 7fe0de287e931e07cb96ecf1f449b2ebdb0e1115 Issue introduced in 2.6.19 with commit 9a53c3a783c2fa9b969628e65695c11c3e51e673 and fixed in 5.15.202 with commit 9894c79fd9466612d0514be157b5c30cd93aa645 Issue introduced in 2.6.19 with commit 9a53c3a783c2fa9b969628e65695c11c3e51e673 and fixed in 6.1.165 with commit cd569b87378b9c33ae13c23d6bb9d205d66f7c4b Issue introduced in 2.6.19 with commit 9a53c3a783c2fa9b969628e65695c11c3e51e673 and fixed in 6.6.128 with commit d3b7ffa90f613938128432c7b2f35b7aa4bdd86b Issue introduced in 2.6.19 with commit 9a53c3a783c2fa9b969628e65695c11c3e51e673 and fixed in 6.12.75 with commit 955c5d670b5ae07c78f4345e23a895638db96ce1 Issue introduced in 2.6.19 with commit 9a53c3a783c2fa9b969628e65695c11c3e51e673 and fixed in 6.18.14 with commit 17866f8a0822d414cb02e621cf003a7d04396ef8 Issue introduced in 2.6.19 with commit 9a53c3a783c2fa9b969628e65695c11c3e51e673 and fixed in 6.19.4 with commit d0bb592fa9def2bace90ac8926c0a1d6fa8c1aa0 Issue introduced in 2.6.19 with commit 9a53c3a783c2fa9b969628e65695c11c3e51e673 and fixed in 7.0 with commit 8cafcb881364af5ef3a8b9fed4db254054033d8a
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-45915
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/fat/namei_msdos.c
fs/fat/namei_vfat.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/7fe0de287e931e07cb96ecf1f449b2ebdb0e1115 https://git.kernel.org/stable/c/9894c79fd9466612d0514be157b5c30cd93aa645 https://git.kernel.org/stable/c/cd569b87378b9c33ae13c23d6bb9d205d66f7c4b https://git.kernel.org/stable/c/d3b7ffa90f613938128432c7b2f35b7aa4bdd86b https://git.kernel.org/stable/c/955c5d670b5ae07c78f4345e23a895638db96ce1 https://git.kernel.org/stable/c/17866f8a0822d414cb02e621cf003a7d04396ef8 https://git.kernel.org/stable/c/d0bb592fa9def2bace90ac8926c0a1d6fa8c1aa0 https://git.kernel.org/stable/c/8cafcb881364af5ef3a8b9fed4db254054033d8a