Skip to main content
Vulnerability Database/CVE-2024-56672

CVE-2024-56672: Linux Kernel Use-After-Free Vulnerability

CVE-2024-56672 is a use-after-free flaw in the Linux kernel blk-cgroup subsystem that can cause memory corruption during cleanup operations. This article covers the technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-56672 Overview

CVE-2024-56672 is a use-after-free [CWE-416] vulnerability in the Linux kernel's block cgroup (blk-cgroup) subsystem. The flaw resides in blkcg_unpin_online(), which walks up the blkcg hierarchy to release online pins. The function called blkcg_parent(blkcg) after blkcg_destroy_blkgs(blkcg), which could free the blkcg structure before the parent pointer was read. A local attacker with low privileges can trigger memory corruption, potentially leading to kernel privilege escalation or denial of service. The issue affects Linux kernel versions up to 6.13-rc2 and was resolved by reading the parent pointer before destroying the blkcg's blkgs.

Critical Impact

Local use-after-free in the block cgroup subsystem can corrupt kernel memory, enabling privilege escalation or kernel crash on affected Linux systems.

Affected Products

  • Linux Kernel (stable branches prior to the fix)
  • Linux Kernel 6.13-rc1
  • Linux Kernel 6.13-rc2

Discovery Timeline

  • 2024-12-27 - CVE-2024-56672 published to NVD
  • 2025-03 - Debian LTS advisories released
  • 2026-10-15 - Last updated in NVD database

Technical Details for CVE-2024-56672

Vulnerability Analysis

The vulnerability is a use-after-free condition in the Linux kernel block I/O cgroup controller. The function blkcg_unpin_online() is responsible for traversing the blkcg hierarchy and releasing online pins from each ancestor. During the traversal, the function invoked blkcg_destroy_blkgs(blkcg) before resolving the parent pointer via blkcg_parent(blkcg).

Under certain scheduling conditions, blkcg_destroy_blkgs() can trigger the final release path of the blkcg structure. Once the structure is freed, the subsequent read of its parent pointer references deallocated slab memory. KASAN reports confirm the read of size 8 against a freed object inside blkcg_unpin_online+0x15a/0x270, triggered from cgwb_release_workfn on the cgwb_release workqueue.

The free path is indirected behind multiple RCU grace periods and a work item execution, making the race window narrow. Reliable reproduction required artificial msleep() injection into blkcg_unpin_online(). The CWE classification is [CWE-416] Use After Free.

Root Cause

The root cause is an ordering bug. blkcg_destroy_blkgs(blkcg) can allow the blkcg object to reach its final kfree() through css_free_rwork_fn(), yet the surrounding code reads blkcg->parent after that call. The fix reorders the operations so the parent pointer is captured before any destruction can occur.

Attack Vector

Exploitation requires local access with low privileges and the ability to influence cgroup lifecycle events, such as creating and destroying block cgroups or writeback cgroups. A local user who can race the writeback cgroup release workqueue (cgwb_release) against block cgroup destruction can trigger the dangling parent pointer read.

Because the free path crosses RCU grace periods and workqueue scheduling, practical exploitation is non-trivial and was only reliably reproduced in test environments with injected delays. The vulnerability is not network-reachable.

// Vulnerable ordering (conceptual, from upstream commit message)
// blkcg_unpin_online() previously:
// blkcg_destroy_blkgs(blkcg); // may free blkcg via RCU + workqueue
// blkcg = blkcg_parent(blkcg); // UAF: reads freed memory
//
// Fixed ordering:
// parent = blkcg_parent(blkcg); // read parent first
// blkcg_destroy_blkgs(blkcg);
// blkcg = parent;

Detection Methods for CVE-2024-56672

Indicators of Compromise

  • KASAN slab-use-after-free reports naming blkcg_unpin_online in the stack trace.
  • Kernel oops or panic originating from cgwb_release_workfn or process_scheduled_works on the cgwb_release workqueue.
  • Unexpected kernel memory corruption events on systems using block I/O cgroups with heavy writeback cgroup churn.

Detection Strategies

  • Inventory running kernels and compare against the fixed stable branches referenced in the upstream git.kernel.org commits (29d1e06, 5baa285, 64afc6f, 86e6ca5).
  • Enable KASAN on test or canary systems to surface the specific blkcg_unpin_online+0x15a/0x270 signature during cgroup stress tests.
  • Monitor dmesg and /var/log/kern.log for BUG: KASAN and slab-use-after-free entries referencing block cgroup symbols.

Monitoring Recommendations

  • Centralize kernel log collection and alert on KASAN reports, general protection fault, and null-pointer dereferences from kernel workqueue contexts.
  • Track package and kernel versions across the Linux fleet to detect hosts that have drifted from the patched baseline.
  • Correlate container and cgroup creation or deletion spikes with kernel error events, particularly in multi-tenant and container orchestration environments.

How to Mitigate CVE-2024-56672

Immediate Actions Required

  • Apply the stable kernel updates that include the upstream fix for blkcg_unpin_online(), available via the referenced git.kernel.org commits.
  • Deploy distribution patches as released by vendors, including the Debian LTS advisories for March 2025 and the Siemens advisory SSA-265688.
  • Prioritize patching multi-tenant hosts, container platforms, and systems where untrusted users can create and destroy cgroups.

Patch Information

The fix captures blkcg_parent(blkcg) before calling blkcg_destroy_blkgs(blkcg), eliminating the use-after-free. Patches are available in the upstream Linux stable tree via commits 29d1e06, 5baa285, 64afc6f, 86e6ca5, 83f5a87, and 8a07350. Distribution updates include the Debian LTS Announcement series.

Workarounds

  • Restrict unprivileged access to cgroup v1 and v2 hierarchies, and limit which users can create or delete block cgroups.
  • Reduce exposure in container runtimes by disabling user namespace cgroup delegation where it is not required.
  • Where patching is delayed, apply vendor-supplied livepatches if available for the affected kernel branch.
bash
# Verify running kernel version against patched baselines
uname -r

# Example: apply distribution updates on Debian-based systems
sudo apt update && sudo apt install --only-upgrade linux-image-$(uname -r | sed 's/[^-]*-[^-]*-//')
sudo reboot

# Restrict delegated cgroup controllers (systemd example)
# /etc/systemd/system.conf
# DefaultCPUAccounting=yes
# DefaultIOAccounting=yes
# Remove 'io' from user slice delegation where not required

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.