CVE-2025-21879

btrfs: fix use-after-free on inode when scanning root during em shrinking

State
Published
Severity
7.8 High
Published
Mar 27, 2025
Updated
Aug 5, 2026
Reserved
Dec 29, 2024

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HLinux
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HCISA-ADP

Weaknesses

Affected Products

ProductVersions
LinuxLinux
  • fef55c4d9c9c22264d2b2ceae1e26922cb6129a5 to before 07836bc18f4ae42da4e922244f4685561c18755eAffected
  • 1020443840569535f6025a855958f07ea3eebf71 to before 5e79d26014f9386387575b9ed60d342057cee49bAffected
  • 1020443840569535f6025a855958f07ea3eebf71 to before 59f37036bb7ab3d554c24abc856aabca01126414Affected
LinuxLinux
  • 6.13Affected
  • before 6.13Not affected
  • 6.13.6 through 6.13.*Not affected
  • 6.14 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.