{
  "affected": [
    {
      "ranges": [
        {
          "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"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "6.13.0"
            },
            {
              "fixed": "6.13.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21879.json"
  },
  "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.",
  "id": "CVE-2025-21879",
  "modified": "2026-07-15T01:49:03.274788276Z",
  "published": "2025-03-27T14:57:08.929Z",
  "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"
    }
  ],
  "schema_version": "1.8.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "btrfs: fix use-after-free on inode when scanning root during em shrinking"
}