CVE-2026-31586
mm: blk-cgroup: fix use-after-free in cgwb_release_workfn()
Reported by linux · Published April 24, 2026
In the Linux kernel, the following vulnerability has been resolved: mm: blk-cgroup: fix use-after-free in cgwb_release_workfn() cgwb_release_workfn() calls css_put(wb->blkcg_css) and then later accesses wb->blkcg_css again via blkcg_unpin_online(). If css_put() drops the last reference, the blkcg can be freed asynchronously (css_free_rwork_fn -> blkcg_css_free -> kfree) before blkcg_unpin_online() dereferences the pointer to access blkcg->online_pin, resulting in a use-after-free: BUG: KASAN: slab-use-after-free in blkcg_unpin_online (./include/linux/instrumented.h:112 ./include/linux/atomic/atomic-instrumented.h:400 ./include/linux/refcount.h:389 ./include/linux/refcount.h:432 ./include/linux/refcount.h:450 block/blk-cgroup.c:1367) Write of size 4 at addr ff11000117aa6160 by task kworker/71:1/531 Workqueue: cgwb_release cgwb_release_workfn Call Trace: <TASK> blkcg_unpin_online (./include/linux/instrumented.h:112 ./include/linux/atomic/atomic-instrumented.h:400 ./include/linux/refcount.h:389 ./include/linux/refcount.h:432 ./include/linux/refcount.h:450 block/blk-cgroup.c:1367) cgwb_release_workfn (mm/backing-dev.c:629) process_scheduled_works (kernel/workqueue.c:3278 kernel/workqueue.c:3385) Freed by task 1016: kfree (./include/linux/kasan.h:235 mm/slub.c:2689 mm/slub.c:6246 mm/slub.c:6561) css_free_rwork_fn (kernel/cgroup/cgroup.c:5542) process_scheduled_works (kernel/workqueue.c:3302 kernel/workqueue.c:3385) ** Stack based on commit 66672af7a095 ("Add linux-next specific files for 20260410") I am seeing this crash sporadically in Meta fleet across multiple kernel versions. A full reproducer is available at: https://github.com/leitao/debug/blob/main/reproducers/repro_blkcg_uaf.sh (The race window is narrow. To make it easily reproducible, inject a msleep(100) between css_put() and blkcg_unpin_online() in cgwb_release_workfn(). With that delay and a KASAN-enabled kernel, the reproducer triggers the splat reliably in less than a second.) Fix this by moving blkcg_unpin_online() before css_put(), so the cgwb's CSS reference keeps the blkcg alive while blkcg_unpin_online() accesses it.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| linux-vmware-6.12 | Chainguard | 6.12.85-r0 |
| kernel6.12-tools-devel | Amazon Linux | 1:6.12.83-113.160.amzn2023 |
| perf | Amazon Linux | 1:6.1.175-219.357.amzn2023 |
| bpftool6.18 | Amazon Linux | 1:6.18.25-55.108.amzn2023 |
| kernel6.18 | Amazon Linux | 1:6.18.25-55.108.amzn2023 |
| python3-perf6.12 | Amazon Linux | 1:6.12.83-113.160.amzn2023 |
| kernel-livepatch-6.18.25-55.108 | Amazon Linux | 1:1.0-0.amzn2023 |
| kernel-tools-devel | Amazon Linux | 1:6.1.175-219.357.amzn2023 |
| kernel6.18-tools | Amazon Linux | 1:6.18.25-55.108.amzn2023 |
| linux-qemu-6.18 | Chainguard | 6.18.31-r0 |
| linux-azure-6.18 | Chainguard | 6.18.31-r0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 59b57717fff8b562825d9d25e0180ad7e8048ca9, 59b57717fff8b562825d9d25e0180ad7e8048ca9, 59b57717fff8b562825d9d25e0180ad7e8048ca9 |
| Linux | Linux | 4.19, 0, 5.10.258 |
| chainguard | linux-vmware-6.12 | 0 |
| amazon:2023 | kernel6.12-tools-devel | 0 |
| amazon:2023 | perf | 0 |
| amazon:2023 | bpftool6.18 | 0 |
| amazon:2023 | kernel6.18 | 0 |
| amazon:2023 | python3-perf6.12 | 0 |
| amazon:2023 | kernel-livepatch-6.18.25-55.108 | 0 |
| amazon:2023 | kernel-tools-devel | 0 |
| amazon:2023 | kernel6.18-tools | 0 |
| chainguard | linux-qemu-6.18 | 0 |
| chainguard | linux-azure-6.18 | 0 |
| amazon:2023 | kernel-tools | 0 |
| amazon:2023 | kernel6.18-headers | 0 |
| chainguard | linux-vmware-6.18 | 0 |
| chainguard | linux-aws-6.18 | 0 |
| chainguard | linux-gcp-6.18 | 0 |
| Linux | Linux | 7.1, 6.18.24, 6.19.14 |
| amazon:2023 | kernel6.18-devel | 0 |
…and 26 more
Timeline
- Apr 24, 2026 CVE Published
- Apr 24, 2026 Security Advisory (102 in total, the first dated here)
- Apr 27, 2026 CVE Updated
- May 18, 2026 EPSS Score (28 in total, the first dated here)
- Jul 18, 2026 Coalition ESS Score
- Aug 11, 2026 Distribution Patch (97 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-31586
vulnetix vdb fixes CVE-2026-31586
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-31586/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart