From mboxrd@z Thu Jan 1 00:00:00 1970 From: AL-KERNEL To: kernel-cve@kernelcve.org Subject: [CVE-2026-31586][IMPORTANT] mm: blk-cgroup: fix use-after-free in cgwb_release_workfn() Date: Tue, 09 Jun 2026 17:55:39 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-AL-KERNEL-CVE: CVE-2026-31586 X-AL-KERNEL-Priority: IMPORTANT X-AL-KERNEL-Severity: IMPORTANT X-AL-KERNEL-Base-Severity: IMPORTANT X-AL-KERNEL-KPANIC: YES X-AL-KERNEL-ActionableScore: 7 X-AL-KERNEL-ActionableScore-Lower: 6 X-AL-KERNEL-Commit: dfc8292a1d6782c76b626315605e0585a5a18447 List-Id: CVE: CVE-2026-31586 Priority: IMPORTANT AL-KERNEL base severity: IMPORTANT KPANIC flag: YES Patch: mm: blk-cgroup: fix use-after-free in cgwb_release_workfn() Commit: dfc8292a1d6782c76b626315605e0585a5a18447 Upstream patch: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=dfc8292a1d6782c76b626315605e0585a5a18447 Original CVE announcement: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-31586 Analysis date: Tue, 09 Jun 2026 17:55:39 -0400 ActionableScore: 7 ActionableScore lower bound: 6 Actionable bucket: Strong Important candidate / Actionable Moderate at minimum Manual review required: YES Summary: A use-after-free in `cgwb_release_workfn()` can occur when `wb->blkcg_css` is released with `css_put()` before `blkcg_unpin_online()` accesses it, allowing a local cgroup/writeback workload to trigger a kernel crash and creating a plausible privilege-escalation concern due to write-after-free behavior. ====================================================================== ABOUT THIS REPORT ====================================================================== The original Linux kernel CVE announcement for CVE-2026-31586 is available here: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-31586 The original announcement does not normally provide a security severity estimate, CVSS assessment, or enough information to determine whether the reported kernel bug represents a practically relevant security issue. This report was generated by AL-KERNEL, an AI-assisted Linux kernel vulnerability analysis system developed by Alexander Larkin. It combines an autonomous classifier with LLM-assisted technical analysis and a separate ActionableScore mechanism. The purpose of this report is to prioritize Linux kernel CVEs before manual review, identify cases that require prompt investigation, and support automatic closure of issues that are unlikely to have meaningful security impact. Published priority for this report: IMPORTANT Manual review required: YES A detailed explanation of the methodology and priority rules is included at the end of this message. ====================================================================== AL-KERNEL CLASSIFICATION RESULT ====================================================================== CVE-2026-31586 IMPORTANT CHECK Maybe valid. Check manually. Hints by AL-KERNEL: The best (paranoid) CVSS is 'AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H';*CWE-416;CWE-362;*CWE-672;Other CVSS 'AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H';BEST CVSS score: '7';DESCR 'A use after free in the cgroup writeback release path can occur because cgwb_release_workfn drops the blkcg CSS reference with css_put before calling blkcg_unpin_online on the same wb blkcg_css pointer. If css_put releases the last reference, the blkcg object can be freed asynchronously and the later blkcg_unpin_online access can write to freed memory. For the CVSS the PR:L is used because a local user or delegated cgroup capable workload may be able to create and tear down cgroup writeback state, even though reliable triggering depends on cgroup and writeback configuration. The issue is not network reachable. Impact is at least local denial of service via KASAN splat or kernel crash, and the UAF write makes limited or full privilege escalation plausible enough for manual review.';YES REQUIRES MANUAL CHECK; ,and ActionableScore result is Strong Important candidate / Actionable Moderate at minimum (with actual score 7) YES LOCK DANGER RACE UAF KERNEL_PANIC_PLUS_UAF KPANIC MEMORY KPANIC INCREASED_TO_HIGH_BASED_ON_ACTIONABLESCOREHIGHEREQTHAN7 NO NO checked ====================================================================== ACTIONABLESCORE ANALYSIS ====================================================================== ActionableScore=7 ActionableScoreLower=6 ## 1. ActionableScore * Conservative score: **6** * Paranoid score: **7** * Final recommended bucket: **Strong Important candidate / Actionable Moderate at minimum**:: ## 2. Signal breakdown Triggered signals: * **Local unprivileged or delegated local trigger: +1** A local workload may influence cgroup writeback lifetime by creating and tearing down writeback activity. In typical systems full cgroup administration may be restricted, but delegated cgroups and containerized workloads make PR:L defensible. * **Privilege escalation plausible, weak to moderate LPE concern: +1 conservative, +2 paranoid** The bug is a real kernel UAF with a write to freed memory. There is no demonstrated reclaim or controlled overwrite primitive, so conservative scoring uses weaker LPE concern. Paranoid scoring raises this because write-after-free in kernel lifetime/refcount logic can sometimes become exploitable. * **Generic memory corruption: +2** KASAN reports a slab-use-after-free in `blkcg_unpin_online()` after `css_put()` may free `wb->blkcg_css`. * **Real lifetime corruption: +1** This is a reference lifetime ordering bug: the blkcg CSS reference is dropped before the object is used again. * **Reliable kernel crash / strong DoS: +1** The crash is observed in production fleet data and is reproducible with an enlarged race window on KASAN kernels. * **Important filesystem/storage path: +1** The issue is in cgroup writeback / blk-cgroup interaction, a core storage/writeback resource-management path. Subtracted signals: * **Hard or unreliable race / special timing required: -1 conservative** The natural race window is narrow. The commit explicitly notes that adding `msleep(100)` makes reproduction reliable. Paranoid score does not subtract this because fleet crashes show real-world triggerability. ## 3. Reachability analysis The issue is **not network reachable**. Triggering requires local activity that creates and releases cgroup writeback state while blk-cgroup references are being dropped. On tightly managed hosts, this may require cgroup control or a workload already placed into managed cgroups by system services. In containerized or delegated-cgroup environments, a reduced-privilege local user or service may have enough influence over workload lifetime and writeback behavior to reach the vulnerable path. The affected path is not an obscure debug-only path. Cgroups, writeback, and blk-cgroup accounting are common on servers and container hosts. Realistic exploitation as privilege escalation is not demonstrated, but realistic crash exposure is supported by the production-fleet observation and KASAN report. ## 4. Severity interpretation This is stronger than an ordinary Moderate because it is a confirmed kernel UAF with a write-after-free in a common resource-management path. The realistic demonstrated impact is local DoS / kernel crash. The theoretical risk is higher because the stale pointer is used after the backing object may have been freed, and the access includes a write to freed memory. Conservative handling: **Actionable Moderate** because exploitation is local, racy, and lacks a proven reclaim or controlled overwrite primitive. Paranoid handling: **Strong Important candidate** because kernel UAF write bugs in lifetime management paths have historically been underestimated and should not be auto-closed without manual review. ## 5. One-sentence report phrase A use-after-free in `cgwb_release_workfn()` can occur when `wb->blkcg_css` is released with `css_put()` before `blkcg_unpin_online()` accesses it, allowing a local cgroup/writeback workload to trigger a kernel crash and creating a plausible privilege-escalation concern due to write-after-free behavior. ## 6. Manual review recommendation **MANUAL CHECK REQUIRED** Reason: confirmed kernel UAF with a write to freed memory, realistic local triggerability, common cgroup/writeback deployment, and plausible but unproven LPE potential. ====================================================================== UPSTREAM PATCH SUMMARY ====================================================================== Patch: mm: blk-cgroup: fix use-after-free in cgwb_release_workfn() Commit: dfc8292a1d6782c76b626315605e0585a5a18447 Upstream URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=dfc8292a1d6782c76b626315605e0585a5a18447 Commit description: 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: 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. Link: https://lore.kernel.org/20260413-blkcg-v1-1-35b72622d16c@debian.org Fixes: 59b5771 ("blkcg: delay blkg destruction until after writeback has finished") Signed-off-by: Breno Leitao Reviewed-by: Dennis Zhou Reviewed-by: Shakeel Butt Cc: David Hildenbrand Cc: Jens Axboe Cc: Johannes Weiner Cc: Josef Bacik Cc: JP Kobryn Cc: Liam Howlett Cc: Lorenzo Stoakes (Oracle) Cc: Martin KaFai Lau Cc: Michal Hocko Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Tejun Heo Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman Changed files: include/linux/instrumented.h include/linux/atomic/atomic-instrumented.h include/linux/refcount.h block/blk-cgroup.c mm/backing-dev.c kernel/workqueue.c include/linux/kasan.h mm/slub.c kernel/cgroup/cgroup.c Diff excerpt: Not included in this email. See the upstream URL for the full patch. Full patch: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=dfc8292a1d6782c76b626315605e0585a5a18447 ====================================================================== DETAILED REPORT METHODOLOGY ====================================================================== The original Linux kernel CVE announcement for CVE-2026-31586 can be found here: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-31586 The original CVE announcement normally does not include a security-level estimate. In particular, it may not contain a CVSS assessment, an impact level, or enough information to determine whether the reported bug is a practically relevant security issue. One purpose of this parallel CVE list is to provide that missing technical and prioritization information. The original goal of the AL-KERNEL project was to prioritize Linux kernel CVE analysis automatically before manual review. The system can also help identify non-security issues that may be suitable for automatic closure. This report was generated by AL-KERNEL, an AI-assisted Linux kernel vulnerability analysis system developed by Alexander Larkin. The first analysis stage combines an autonomous classifier with additional LLM-based analysis. The autonomous classifier runs locally on a CPU and is based on a backpropagation neural network. Together, these mechanisms produce a technical vulnerability description, identify likely weakness types, estimate CVSS severity, and provide input for ActionableScore. Two CVSS estimates are retained because incomplete kernel vulnerability information often permits more than one defensible interpretation: Conservative CVSS vector: AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H The Best / paranoid CVSS vector: AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H The Best / paranoid CVSS score: 7 The conservative vector represents a lower-impact interpretation. The Best/paranoid vector intentionally represents a plausible upper-bound interpretation and should not automatically be treated as demonstrated real-world impact. CVSS may also need to be adjusted for a particular Linux deployment, because actual reachability, privileges, enabled kernel configuration, hardware, namespaces, exposed device nodes, and other environmental conditions can differ significantly between systems. A separate ActionableScore mechanism evaluates practical remediation urgency. Its analysis may include reachability, attack prerequisites, subsystem exposure, memory-corruption characteristics, denial-of-service reliability, and possible confidentiality, integrity, or privilege-escalation impact. Conservative ActionableScore: 6 Paranoid ActionableScore: 7 The final base severity is taken directly from the second tab-separated field of the AL-KERNEL classification result. ActionableScore does not replace or independently override that final AL-KERNEL decision, and if ActionableScore adjusted impact level of ALKERNEL, then you would see self-readable flags above like INCREASED_TO_HIGH_BASED_ON_ACTIONABLESCOREHIGHEREQTHAN7. For an AL-KERNEL result of MODERATE, this report uses the following additional presentation split: ActionableScore below 5 -> MODERATE REGULAR ActionableScore 5 or more -> MODERATE 7.0 The distinction between MODERATE REGULAR and MODERATE 7.0 makes it possible to identify Moderate issues that should receive manual analysis and fixes before lower-priority MODERATE REGULAR issues. In many cases, MODERATE REGULAR fixes may wait for a later rebase or routine update. There is one override in which MODERATE REGULAR becomes MODERATE 7.0 even when the ActionableScore is below 5. When the AL-KERNEL result contains the KPANIC flag, a MODERATE result is always presented as MODERATE 7.0. The KPANIC flag selected with few regexps without usage of AI at all, so it helps to detect cases when Kernel Crash happens and similar (to filter False-Negative results from the LLM usage). KPANIC indicates that a reliable kernel crash, kernel panic, or similarly serious kernel availability impact was identified by the classification workflow. AL-KERNEL base severity for this report: IMPORTANT KPANIC detected for this report: YES Published priority for this report (same as in Subject): IMPORTANT These results are intended to support engineering triage. They are machine-generated estimates, and cases marked for manual review should be validated by a human security engineer before final disposition. For more info read docs linked from here: https://kernelcve.org/ (and you can submit you own patch there to generate such a report for non-existant CVE-id yet). Note that in many cases this AI tool selects higher severity, than real is (means you can expect Importants instead of Moderate 7.0 or Moderates 7.0 instead of regular Moderates). If you see such cases, please use reply email interface to add additional manual analyses info to this particular CVE. And please, please, let me know when you see Lows instead of Importants or Important instead of Low (because particular for such cases I need to tune this AI tool to make it better for this one and next similar). My contact email for such notifications is alexanjelausa@gmail.com (and both send reply to CVE record itself too and see "reply" button below for howto reply).