Skip to content
Heist/ feed
Back to feed
HighFix available

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

Type: advisorySources: OSV

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.

Products
Kernel
Affected versions
Not specified
Fixed versions
6.13.6
CVEs
CVE-2025-21879
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 11:42 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 27 Mar 2025, 14:57 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.

osv:CVE-2025-21879

Kernel

Fixed versions: 6.13.6

Complete source record
{
  "id": "380f6ccc17ebe1d1a497363b97a74a115921ea4f28cdf8526c7a44b142785cc7",
  "url": "https://osv.dev/vulnerability/CVE-2025-21879",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "btrfs: fix use-after-free on inode when scanning root during em shrinking",
    "summary": "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.",
    "evidence": "osv:CVE-2025-21879",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.13.6",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "CVE-2025-21879",
      "aliases": [
        "CVE-2025-21879"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "fef55c4d9c9c22264d2b2ceae1e26922cb6129a5"
                },
                {
                  "fixed": "07836bc18f4ae42da4e922244f4685561c18755e"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "1020443840569535f6025a855958f07ea3eebf71"
                },
                {
                  "fixed": "5e79d26014f9386387575b9ed60d342057cee49b"
                },
                {
                  "fixed": "59f37036bb7ab3d554c24abc856aabca01126414"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-21879.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.13.6"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-21879.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:50.616930874Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/07836bc18f4ae42da4e922244f4685561c18755e",
        "https://git.kernel.org/stable/c/59f37036bb7ab3d554c24abc856aabca01126414",
        "https://git.kernel.org/stable/c/5e79d26014f9386387575b9ed60d342057cee49b",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21879.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-21879",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21879.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-21879",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 519167,
  "published_at": "2025-03-27T14:57:08.929+00:00"
}