{"id":"CVE-2025-21879","summary":"btrfs: fix use-after-free on inode when scanning root during em shrinking","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix use-after-free on inode when scanning root during em shrinking\n\nAt btrfs_scan_root() we are accessing the inode's root (and fs_info) in a\ncall to btrfs_fs_closing() after we have scheduled the inode for a delayed\niput, and that can result in a use-after-free on the inode in case the\ncleaner kthread does the iput before we dereference the inode in the call\nto btrfs_fs_closing().\n\nFix this by using the fs_info stored already in a local variable instead\nof doing inode-\u003eroot-\u003efs_info.","modified":"2026-07-15T01:49:03.274788276Z","published":"2025-03-27T14:57:08.929Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21879.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/07836bc18f4ae42da4e922244f4685561c18755e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/59f37036bb7ab3d554c24abc856aabca01126414"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5e79d26014f9386387575b9ed60d342057cee49b"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21879.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-21879"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"fef55c4d9c9c22264d2b2ceae1e26922cb6129a5"},{"fixed":"07836bc18f4ae42da4e922244f4685561c18755e"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"1020443840569535f6025a855958f07ea3eebf71"},{"fixed":"5e79d26014f9386387575b9ed60d342057cee49b"},{"fixed":"59f37036bb7ab3d554c24abc856aabca01126414"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-21879.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.13.6"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-21879.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}