7.8high
btrfs: fix use-after-free on inode when scanning root during em shrinking
- Severity
- 7.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.21% (higher than 11% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: btrfs: fix use-after-free on inode when scanning root during em shrinking At btrfs_scan_root() we are accessing the inode's root (and fs_info) in a call to btrfs_fs_closing() after we have scheduled the inode for a delayed iput, and that can result in a use-after-free on the inode in case the cleaner kthread does the iput before we dereference the inode in the call to btrfs_fs_closing(). Fix this by using the fs_info stored already in a local variable instead of doing inode->root->fs_info.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from fef55c4d9c9c22264d2b2ceae1e26922cb6129a5 before 07836bc18f4ae42da4e922244f4685561c18755e, from 1020443840569535f6025a855958f07ea3eebf71 before 5e79d26014f9386387575b9ed60d342057cee49b, from 1020443840569535f6025a855958f07ea3eebf71 before 59f37036bb7ab3d554c24abc856aabca01126414, 6.13 Not affected: before 6.13, from 6.13.6 up to 6.13.*, from 6.14 up to * | CVE List |
| linux linux_kernel | from 6.13 before 6.13.6, 6.14 | NVD |
All scores
| Linux | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CISA-ADP | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: btrfs: fix use-after-free on inode when scanning root during em shrinking At btrfs_scan_root() we are accessing the inode's root (and fs_info) in a call to btrfs_fs_closing() after we have scheduled the inode for a delayed iput, and that can result in a use-after-free on the inode in case the cleaner kthread does the iput before we dereference the inode in the call to btrfs_fs_closing(). Fix this by using the fs_info stored already in a local variable instead of doing inode->root->fs_info.
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: btrfs: se corrige el use-after-free en el inodo al escanear la raíz durante la reducción de em. En btrfs_scan_root(), accedemos a la raíz del inodo (y a fs_info) en una llamada a btrfs_fs_closing() después de haber programado el inodo para una entrada retrasada, lo que puede resultar en un use-after-free en el inodo en caso de que el kthread más limpio realice la entrada antes de que desreferenciamos el inodo en la llamada a btrfs_fs_closing(). Se soluciona esto usando la fs_info ya almacenada en una variable local en lugar de hacer inode->root->fs_info.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-21879 changed 2026-08-05 | CVE Terms of Use |
| NVD | CVE-2025-21879 changed 2026-06-17 | Public domain |