Bug 2355407 (CVE-2025-21879) - CVE-2025-21879 kernel: btrfs: fix use-after-free on inode when scanning root during em shrinking
Summary: CVE-2025-21879 kernel: btrfs: fix use-after-free on inode when scanning root ...
Keywords:
Status: NEW
Alias: CVE-2025-21879
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-03-27 16:01 UTC by OSIDB Bzimport
Modified: 2025-04-01 04:19 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-03-27 16:01:51 UTC
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.

Comment 1 Avinash Hanwate 2025-03-28 06:21:43 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025032711-CVE-2025-21879-f338@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.