blk-cgroup: fix leaks and online flag on radix_tree_insert failure
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 7fcf2b033b84e261dca283bc2911aaea4b07b525 · < 4c0d150fb98ea40760611979f4e664c244b20966| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
blk-cgroup: fix leaks and online flag on radix_tree_insert failure
When radix_tree_insert() fails in blkg_create(), the error path has two issues:
1. blkg->online is set to true unconditionally, even when the blkg was never fully inserted. Move the assignment inside the success block.
2. The error path calls blkg_put() without first calling percpu_ref_kill(). Because the refcount is still in percpu mode, percpu_ref_put() only does this_cpu_sub() without checking for zero, so blkg_release() is never triggered. This permanently leaks the blkg memory, its percpu iostat, policy data, the parent blkg reference, and the cgroup css reference — the latter preventing the cgroup from ever being destroyed.
Fix by replacing blkg_put() with percpu_ref_kill(), matching the pattern used in blkg_destroy().
From the CVE record · Linux
The Linux kernel's blk-cgroup error path can leak memory and references when radix_tree_insert() fails during blkg creation, preventing an affected cgroup from being destroyed. The input does not describe an attacker-controlled trigger or specify network access, authentication, or user interaction requirements.
Engineers running the Linux kernel should check their deployments; affected versions are not specified.