{
  "cveId": "CVE-2023-54158",
  "url": "https://patchblox.com/security/cve/CVE-2023-54158",
  "summary": "CVE-2023-54158 is fixed in 20 products on 1 platform, first by ALAS2023-2023-184, released May 25, 2023. It is not reported as exploited. Patch Radar priority: High.",
  "title": "linux: In the Linux kernel, the following vulnerability has been resolved:  btrfs: don\u0027t free qgroup space unless specified...",
  "description": "In the Linux kernel, the following vulnerability has been resolved:  btrfs: don\u0027t free qgroup space unless specified  Boris noticed in his simple quotas testing that he was getting a leak with Sweet Tea\u0027s change to subvol create that stopped doing a transaction commit.  This was just a side effect of that change.  In the delayed inode code we have an optimization that will free extra reservations if we think we can pack a dir item into an already modified leaf.  Previously this wouldn\u0027t be triggered in the subvolume create case because we\u0027d commit the transaction, it was still possible but much harder to trigger.  It could actually be triggered if we did a mkdir \u0026\u0026 subvol create with qgroups enabled.  This occurs because in btrfs_insert_delayed_dir_index(), which gets called when we\u0027re adding the dir item, we do the following:    btrfs_block_rsv_release(fs_info, trans-\u003Eblock_rsv, bytes, NULL);  if we\u0027re able to skip reserving space.  The problem here is that trans-\u003Eblock_rsv points at the temporary block rsv for the subvolume create, which has qgroup reservations in the block rsv.  This is a problem because btrfs_block_rsv_release() will do the following:    if (block_rsv-\u003Eqgroup_rsv_reserved \u003E= block_rsv-\u003Eqgroup_rsv_size) { \t  qgroup_to_release = block_rsv-\u003Eqgroup_rsv_reserved - \t\t  block_rsv-\u003Eqgroup_rsv_size; \t  block_rsv-\u003Eqgroup_rsv_reserved = block_rsv-\u003Eqgroup_rsv_size;   }  The temporary block rsv just has -\u003Eqgroup_rsv_reserved set, -\u003Eqgroup_rsv_size == 0.  The optimization in btrfs_insert_delayed_dir_index() sets -\u003Eqgroup_rsv_reserved = 0.  Then later on when we call btrfs_subvolume_release_metadata() which has    btrfs_block_rsv_release(fs_info, rsv, (u64)-1, \u0026qgroup_to_release);   btrfs_qgroup_convert_reserved_meta(root, qgroup_to_release);  qgroup_to_release is set to 0, and we do not convert the reserved metadata space.  The problem here is that the block rsv code has been unconditionally messing with -\u003Eqgroup_rsv_reserved, because the main place this is used is delalloc, and any time we call btrfs_block_rsv_release() we do it with qgroup_to_release set, and thus do the proper accounting.  The subvolume code is the only other code that uses the qgroup reservation stuff, but it\u0027s intermingled with the above optimization, and thus was getting its reservation freed out from underneath it and thus leaking the reserved space.  The solution is to simply not mess with the qgroup reservations if we don\u0027t have qgroup_to_release set.  This works with the existing code as anything that messes with the delalloc reservations always have qgroup_to_release set.  This fixes the leak that Boris was observing.",
  "published": "2023-05-25T17:41:00Z",
  "severity": "important",
  "epss": 0.00244,
  "epssPercentile": 0.15722,
  "priority": "High",
  "priorityTier": 3,
  "exploited": false,
  "vendorExploited": false,
  "disclosed": false,
  "fixes": [
    {
      "platform": "linux",
      "product": "bpftool",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "bpftool-debuginfo",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-debuginfo",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-debuginfo-common-aarch64",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-debuginfo-common-x86_64",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-devel",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-headers",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-libbpf",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-libbpf-devel",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-libbpf-static",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-livepatch-6.1.29-47.49",
      "release": "amzn 2023",
      "fixedVersion": "1.0-0.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-tools",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-tools-debuginfo",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "kernel-tools-devel",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "linux",
      "release": "Debian 12.15 (bookworm)",
      "fixedVersion": "6.1.37-1",
      "fix": "DEBIAN-CVE-2023-54158",
      "url": "https://patchblox.com/security/fix/linux/debian-cve-2023-54158",
      "released": "2025-12-24T13:16:17Z"
    },
    {
      "platform": "linux",
      "product": "linux",
      "release": "Debian 13.5 (trixie)",
      "fixedVersion": "6.3.7-1",
      "fix": "DEBIAN-CVE-2023-54158",
      "url": "https://patchblox.com/security/fix/linux/debian-cve-2023-54158",
      "released": "2025-12-24T13:16:17Z"
    },
    {
      "platform": "linux",
      "product": "linux",
      "release": "Debian 14",
      "fixedVersion": "6.3.7-1",
      "fix": "DEBIAN-CVE-2023-54158",
      "url": "https://patchblox.com/security/fix/linux/debian-cve-2023-54158",
      "released": "2025-12-24T13:16:17Z"
    },
    {
      "platform": "linux",
      "product": "perf",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "perf-debuginfo",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "python3-perf",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    },
    {
      "platform": "linux",
      "product": "python3-perf-debuginfo",
      "release": "amzn 2023",
      "fixedVersion": "6.1.29-47.49.amzn2023",
      "fix": "ALAS2023-2023-184",
      "url": "https://patchblox.com/security/fix/linux/alas2023-2023-184",
      "released": "2023-05-25T17:41:00Z"
    }
  ],
  "noFixYet": [],
  "dataAsOf": "2026-11-09T01:18:40Z",
  "attribution": {
    "text": "Data: Patchblox Patch Radar",
    "url": "https://patchblox.com/security/patch-radar",
    "terms": "https://patchblox.com/security/patch-radar/use-the-data"
  }
}