Look up another CVE · open CVE-2023-54107 in the interactive tracker
CVE-2023-54107
blk-cgroup: dropping parent refcount after pd_free_fn() is done
Published 2025-12-24 (10 months ago) by the Linux kernel CNA. Subsystem block. Debian urgency: not yet assigned.
What to do, per Debian release
Debian's own status for CVE-2023-54107 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source
| Release | Status | Version | What this means |
|---|---|---|---|
| Debian 12bookworm | vulnerable | 6.1.190-1 | No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication. |
| Debian 13trixie | fixed | 6.3.7-1 | Update the kernel and reboot. Fixed in 6.3.7-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 6.3.7-1 | Update the kernel and reboot. Fixed in 6.3.7-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.3.7-1 | Update the kernel and reboot. Fixed in 6.3.7-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
Some cgroup policies will access parent pd through child pd even after pd_offline_fn() is done. If pd_free_fn() for parent is called before child, then UAF can be triggered. Hence it's better to guarantee the order of pd_free_fn(). Currently refcount of parent blkg is dropped in __blkg_release(), which is before pd_free_fn() is called in blkg_free_work_fn() while blkg_free_work_fn() is called asynchronously. This patch make sure pd_free_fn() called from removing cgroup is ordered by delaying dropping parent refcount after calling pd_free_fn() for child. BTW, pd_free_fn() will also be called from blkcg_deactivate_policy() from deleting device, and following patches will guarantee the order.
Where it lives
The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.
block/blk-cgroup.c
- What this is
- CONTROL GROUP - BLOCK IO CONTROLLER (BLKIO)MAINTAINERS section matched on block/blk-cgroup.c · cgroups@vger.kernel.org
Check it on the machine
grep -w CONFIG_BLK_CGROUP /boot/config-$(uname -r)Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.
Show whether Debian builds this, per release
Debian builds this code. Every release below compiles the affected file into the kernels it ships.
- bookworm, trixie, forky, sidy
- y
- built into the kernel image on every flavour - only a patch removes it
- Build switch
- CONFIG_BLK_CGROUP
From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages
Signals
- Published
- 2025-12-24 (10 months ago)source
- CVSS
- 7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it - Attack vector
- local (AV:L)source
- EPSS
- 0.15%, higher than 3.9% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- not yet assignedsource
- Subsystem
- block
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 5.18 | 6.3 | c7241babf085 |
Why the CNA scored it this way
Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source
- AV:LAttack vector, local
- 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.
- AC:LAttack complexity, low
- 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.
- PR:LPrivileges required, low
- 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.
- UI:NUser interaction, none
- The attacker performs the entire sequence — cgroup creation, I/O generation, and rmdir — in its own process with no action by any other user.
- S:UScope, unchanged
- The corruption is confined to kernel heap objects managed by the same kernel security authority; no VM, hypervisor, or IOMMU boundary is crossed.
- C:HConfidentiality impact, high
- 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.
- I:HIntegrity impact, high
- __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.
- A:HAvailability impact, high
- 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.