fat: avoid parent link count underflow in rmdir
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 9a53c3a783c2fa9b969628e65695c11c3e51e673 · < 17866f8a0822d414cb02e621cf003a7d04396ef8| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
A corrupted FAT image can give a directory inode an incorrect link count. Removing a directory from that image can underflow the parent link count and trigger a kernel warning. The input does not specify an authentication requirement or network attack path.
Engineers running Linux kernels that handle FAT filesystems should check whether their kernel includes this fix; affected versions are not specified.