{"answers":{"affected":"","exploited":"There is no known exploitation of CVE-2023-54158 in the wild and no public exploit code.","fix":"Apply the vendor's patch.","what":"CVE-2023-54158 is a denial of service vulnerability in Linux, published on 24 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2023-54158 and fix it if it is affected.\n\nWhat it is: CVE-2023-54158 is a denial of service vulnerability in Linux, published on 24 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2023-54158 in the wild and no public exploit code.\n\nAffected product: Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-54158/ (Markdown: https://insights.sbomify.com/CVE-2023-54158/index.md)","id":"CVE-2023-54158","markdown":"https://insights.sbomify.com/CVE-2023-54158/index.md","name":"CVE-2023-54158","record":{"aliases":["BELL-CVE-2023-54158","DEBIAN-CVE-2023-54158","GHSA-crmq-c99h-f986","UBUNTU-CVE-2023-54158"],"analysis":{"component_type":"kernel","fix_type":"patch","impacts":["denial_of_service"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"Linux kernel","requires_auth":"low_privilege","summary":"A logic error in the Linux kernel btrfs filesystem can cause a resource leak, leading to denial of service when qgroups are enabled.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"Linux","cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: don't free qgroup space unless specified\n\nBoris noticed in his simple quotas testing that he was getting a leak\nwith Sweet Tea's change to subvol create that stopped doing a\ntransaction commit.  This was just a side effect of that change.\n\nIn the delayed inode code we have an optimization that will free extra\nreservations if we think we can pack a dir item into an already modified\nleaf.  Previously this wouldn't be triggered in the subvolume create\ncase because we'd commit the transaction, it was still possible but\nmuch harder to trigger.  It could actually be triggered if we did a\nmkdir \u0026\u0026 subvol create with qgroups enabled.\n\nThis occurs because in btrfs_insert_delayed_dir_index(), which gets\ncalled when we're adding the dir item, we do the following:\n\n  btrfs_block_rsv_release(fs_info, trans-\u003eblock_rsv, bytes, NULL);\n\nif we're able to skip reserving space.\n\nThe problem here is that trans-\u003eblock_rsv points at the temporary block\nrsv for the subvolume create, which has qgroup reservations in the block\nrsv.\n\nThis is a problem because btrfs_block_rsv_release() will do the\nfollowing:\n\n  if (block_rsv-\u003eqgroup_rsv_reserved \u003e= block_rsv-\u003eqgroup_rsv_size) {\n\t  qgroup_to_release = block_rsv-\u003eqgroup_rsv_reserved -\n\t\t  block_rsv-\u003eqgroup_rsv_size;\n\t  block_rsv-\u003eqgroup_rsv_reserved = block_rsv-\u003eqgroup_rsv_size;\n  }\n\nThe temporary block rsv just has -\u003eqgroup_rsv_reserved set,\n-\u003eqgroup_rsv_size == 0.  The optimization in\nbtrfs_insert_delayed_dir_index() sets -\u003eqgroup_rsv_reserved = 0.  Then\nlater on when we call btrfs_subvolume_release_metadata() which has\n\n  btrfs_block_rsv_release(fs_info, rsv, (u64)-1, \u0026qgroup_to_release);\n  btrfs_qgroup_convert_reserved_meta(root, qgroup_to_release);\n\nqgroup_to_release is set to 0, and we do not convert the reserved\nmetadata space.\n\nThe problem here is that the block rsv code has been unconditionally\nmessing with -\u003eqgroup_rsv_reserved, because the main place this is used\nis delalloc, and any time we call btrfs_block_rsv_release() we do it\nwith qgroup_to_release set, and thus do the proper accounting.\n\nThe subvolume code is the only other code that uses the qgroup\nreservation stuff, but it's intermingled with the above optimization,\nand thus was getting its reservation freed out from underneath it and\nthus leaking the reserved space.\n\nThe solution is to simply not mess with the qgroup reservations if we\ndon't have qgroup_to_release set.  This works with the existing code as\nanything that messes with the delalloc reservations always have\nqgroup_to_release set.  This fixes the leak that Boris was observing.","ecosystems":[],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"btrfs: don't free qgroup space unless specified","id":"CVE-2023-54158","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":null,"product":null,"products":[],"type":"denial_of_service","year":"2023"},"n_packages":0,"n_references":7,"next":{"headline":"usb: mtu3: fix kernel panic at qmu transfer done irq handler","id":"CVE-2023-54159"},"packages":[],"prev":{"headline":"binder: fix UAF of alloc-\u003evma in race with munmap()","id":"CVE-2023-54157"},"products":["Linux"],"published":"2025-12-24","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2026-05-11","vendors":["Linux"]},"summary":"A logic error in the Linux kernel btrfs filesystem can cause a resource leak, leading to denial of service when qgroups are enabled.","url":"https://insights.sbomify.com/CVE-2023-54158/"}