{"id":"CVE-2023-54107","state":"PUBLISHED","title":"blk-cgroup: dropping parent refcount after pd_free_fn() is done","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nblk-cgroup: dropping parent refcount after pd_free_fn() is done\n\nSome cgroup policies will access parent pd through child pd even\nafter pd_offline_fn() is done. If pd_free_fn() for parent is called\nbefore child, then UAF can be triggered. Hence it's better to guarantee\nthe order of pd_free_fn().\n\nCurrently refcount of parent blkg is dropped in __blkg_release(), which\nis before pd_free_fn() is called in blkg_free_work_fn() while\nblkg_free_work_fn() is called asynchronously.\n\nThis patch make sure pd_free_fn() called from removing cgroup is ordered\nby delaying dropping parent refcount after calling pd_free_fn() for\nchild.\n\nBTW, pd_free_fn() will also be called from blkcg_deactivate_policy()\nfrom deleting device, and following patches will guarantee the order.","publishedAt":"2025-12-24T13:06:31.505Z","updatedAt":"2026-10-30T12:17:40.061Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"d578c770c85233af592e54537f93f3831bde7e9a","status":"affected","lessThan":"c2f355e68126fd374e3bc0782aa6840faa7d3b1f","versionType":"git"},{"version":"d578c770c85233af592e54537f93f3831bde7e9a","status":"affected","lessThan":"c7241babf0855d8a6180cd1743ff0ec34de40b4e","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["block/blk-cgroup.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.18","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["block/blk-cgroup.c"]}],"references":["https://git.kernel.org/stable/c/c2f355e68126fd374e3bc0782aa6840faa7d3b1f","https://git.kernel.org/stable/c/c7241babf0855d8a6180cd1743ff0ec34de40b4e"],"weaknesses":[],"ingestedAt":"2026-10-30T12:34:06.950Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2023/54xxx/CVE-2023-54107.json","commit":"db8103c5921aac81d5d90efcf3745980dafabf49","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2023-54107","state":"PUBLISHED","datePublished":"2025-12-24T13:06:31.505Z","dateUpdated":"2026-10-30T12:17:40.061Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-12-24T13:02:52.517Z"},"containers":{"cna":{"title":"blk-cgroup: dropping parent refcount after pd_free_fn() is done","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nblk-cgroup: dropping parent refcount after pd_free_fn() is done\n\nSome cgroup policies will access parent pd through child pd even\nafter pd_offline_fn() is done. If pd_free_fn() for parent is called\nbefore child, then UAF can be triggered. Hence it's better to guarantee\nthe order of pd_free_fn().\n\nCurrently refcount of parent blkg is dropped in __blkg_release(), which\nis before pd_free_fn() is called in blkg_free_work_fn() while\nblkg_free_work_fn() is called asynchronously.\n\nThis patch make sure pd_free_fn() called from removing cgroup is ordered\nby delaying dropping parent refcount after calling pd_free_fn() for\nchild.\n\nBTW, pd_free_fn() will also be called from blkcg_deactivate_policy()\nfrom deleting device, and following patches will guarantee the order."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"d578c770c85233af592e54537f93f3831bde7e9a","status":"affected","lessThan":"c2f355e68126fd374e3bc0782aa6840faa7d3b1f","versionType":"git"},{"version":"d578c770c85233af592e54537f93f3831bde7e9a","status":"affected","lessThan":"c7241babf0855d8a6180cd1743ff0ec34de40b4e","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["block/blk-cgroup.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.18","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["block/blk-cgroup.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/c2f355e68126fd374e3bc0782aa6840faa7d3b1f"},{"url":"https://git.kernel.org/stable/c/c7241babf0855d8a6180cd1743ff0ec34de40b4e"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - Triggering requires local cgroup filesystem operations (mkdir/rmdir of nested cgroups, writes to io.max/io.weight/io.latency) plus block I/O to populate blkgs. There is no remote or adjacent-network path into blk-cgroup teardown.\nAC:L - Although the UAF arises from unordered asynchronous work items and timers, the attacker controls both sides — building the nested blkcg hierarchy, choosing the tear-down order and timing, looping thousands of create/destroy cycles, and loading system_wq to widen the window while pd_free_fn sleeps (hrtimer_cancel, blk_put_queue). The iocost/throttle timers also fire on their own, so the window recurs without any condition outside attacker influence.\nPR:L - An unprivileged local account with a delegated cgroup v2 subtree suffices — standard systemd user slices and rootless/OCI containers grant mkdir/rmdir plus ownership of the non-root io.max, io.weight and io.latency files in cgroups the user creates, and bfq/blk-throttle policies are active without any privileged setup. No real root in the initial namespace is needed.\nUI:N - The attacker performs the entire sequence — cgroup creation, I/O generation, and rmdir — in its own process with no action by any other user.\nS:U - The corruption is confined to kernel heap objects managed by the same kernel security authority; no VM, hypervisor, or IOMMU boundary is crossed.\nC:H - The freed parent ioc_gq/throtl_grp/bfq_group lives in a general kmalloc cache, and __propagate_weights()/current_hweight() read child_active_sum, child_inuse_sum, active and inuse straight out of the reclaimed slot, with results observable via io.stat and scheduling behaviour. Heap grooming turns this into a controllable kernel-memory disclosure primitive.\nI:H - __propagate_weights() performs read-modify-write arithmetic directly on the freed parent object (parent->child_active_sum += ..., parent->child_inuse_sum += ...) with deltas derived from attacker-chosen io.weight values, and throtl_rb_erase() writes rb-tree pointers into the freed parent service queue. Sprayed into an attacker-chosen reclaimed object, this is a write primitive leading to control-flow hijack and privilege escalation.\nA:H - Use-after-free access and modification of freed slab memory reliably produces KASAN splats, rb-tree/slab corruption, and kernel oops or panic, and the sequence can be repeated at will to crash the machine."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:17:40.061Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"6.3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2023-54107","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-10-15T21:38:32.237187Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-15T21:41:39.921Z"}}]}}}