{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-22019",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-22019"
  ],
  "published": "2025-04-16T10:20:49Z",
  "summary": "bcachefs: bch2_ioctl_subvolume_destroy() fixes",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nbcachefs: bch2_ioctl_subvolume_destroy() fixes\n\nbch2_evict_subvolume_inodes() was getting stuck - due to incorrectly\npruning the dcache.\n\nAlso, fix missing permissions checks.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.12.20-1+rpt1~bpo12+1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.12.20+rpt-rpi-2712",
            "binary_version": "1:6.12.20-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.20+rpt-rpi-v6",
            "binary_version": "1:6.12.20-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.20+rpt-rpi-v7",
            "binary_version": "1:6.12.20-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.20+rpt-rpi-v7l",
            "binary_version": "1:6.12.20-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.20+rpt-rpi-v8",
            "binary_version": "1:6.12.20-1+rpt1~bpo12+1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.12.20-1+rpt1~bpo12+1": {
            "linux_commit": "cd231d4775b14f228606c09f219b48308f6ab3aa",
            "upstream_version": "6.12.20",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.22"
          }
        }
      }
    },
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:13",
        "name": "linux"
      },
      "versions": [
        "1:6.12.19-1+rpt1~bpo12+1",
        "1:6.12.19-1+rpt1",
        "1:6.12.20-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-2712",
            "binary_version": "1:6.12.19-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v6",
            "binary_version": "1:6.12.19-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v7",
            "binary_version": "1:6.12.19-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v7l",
            "binary_version": "1:6.12.19-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v8",
            "binary_version": "1:6.12.19-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-2712",
            "binary_version": "1:6.12.19-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v6",
            "binary_version": "1:6.12.19-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v7",
            "binary_version": "1:6.12.19-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v7l",
            "binary_version": "1:6.12.19-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v8",
            "binary_version": "1:6.12.19-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.20+rpt-rpi-2712",
            "binary_version": "1:6.12.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.20+rpt-rpi-v6",
            "binary_version": "1:6.12.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.20+rpt-rpi-v7",
            "binary_version": "1:6.12.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.20+rpt-rpi-v7l",
            "binary_version": "1:6.12.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.20+rpt-rpi-v8",
            "binary_version": "1:6.12.20-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.12.19-1+rpt1~bpo12+1": {
            "linux_commit": "121c2c384b9c2f4790ffb31b2cd25c7d75c8fda0",
            "upstream_version": "6.12.19",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.22"
          },
          "1:6.12.19-1+rpt1": {
            "linux_commit": "121c2c384b9c2f4790ffb31b2cd25c7d75c8fda0",
            "upstream_version": "6.12.19",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.22"
          },
          "1:6.12.20-1+rpt1": {
            "linux_commit": "cd231d4775b14f228606c09f219b48308f6ab3aa",
            "upstream_version": "6.12.20",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.22"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-22019"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/9e6e83e1e2d01b99e70cd7812d7f758a8def9fc8"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/82383abd39abd635511b8956284a5cc8134c4dc1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/558317a5c61045d460a37372181e7b43c0c002bb"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/707549600c4a012ed71c0204a7992a679880bf33"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T12:19:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.3,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The bug is reached through `ioctl(BCH_IOCTL_SUBVOLUME_DESTROY)` on any open file descriptor belonging to a mounted bcachefs filesystem, which requires local access to the system. There is no network-facing path into `bch2_fs_file_ioctl()`.\nAC:L - The attacker deterministically triggers both defects with a single ioctl call \u2014 no race, no memory-layout dependence, no timing window; the dcache state that wedges `bch2_evict_subvolume_inodes()` is created by the attacker simply by walking into the subvolume beforehand. No conditions lie outside the attacker's control.\nPR:L - `BCH_IOCTL_SUBVOLUME_DESTROY` has no `capable()` check and, before this fix, no `inode_permission()` check, so an ordinary unprivileged local user needs only an fd on the bcachefs mount plus search (`MAY_EXEC`) permission along the path to the victim subvolume. No CAP_SYS_ADMIN, no user-namespace trick, and no ownership of or write access to the target is required.\nUI:N - The attacker issues the ioctl directly with no action by any other user; the mounted bcachefs filesystem is an ambient system configuration, not a victim-performed step at exploit time.\nS:U - The vulnerable code and the impacted resources (kernel filesystem state, on-disk subvolume data) are managed by the same security authority \u2014 the kernel. This is a standard in-kernel DAC-bypass/DoS with no VM, IOMMU, or sandbox boundary crossed.\nC:L - There is no direct arbitrary-read primitive, but the DAC bypass has bounded disclosure consequences: after destroying a root- or other-user-owned subvolume in a directory the attacker can write to, the attacker can recreate the path and have a privileged process deposit sensitive data into attacker-controlled storage, and the non-invalidated dcache subtree leaves stale dentries/inodes referencing a freed subvolume ID that can be reused by another user's newly created subvolume.\nI:H - An unprivileged user can permanently destroy any subvolume they can merely traverse to \u2014 including root-owned subvolumes and other users' mode-0700 subvolumes \u2014 bypassing all ownership, write-permission, sticky-bit and non-empty-directory protections, which is unauthorized destruction of arbitrary data on the filesystem. The stale, still-hashed dentry subtree over a deleted subvolume additionally permits writes through inodes whose subvolume ID may be reused.\nA:H - The `d_delete()` bug leaves `bch2_evict_subvolume_inodes()` stuck in `TASK_UNINTERRUPTIBLE`, producing an unkillable D-state kworker that holds `BCH_WRITE_REF_snapshot_delete_pagecache` forever \u2014 unmount and read-only transitions hang, all further subvolume deletions stall, and recovery requires a reboot. Independently, arbitrary destruction of subvolumes (e.g. one holding `/home` or a database) is total loss of the affected data."
    }
  }
}
