CVE-2026-64378 in Linuxinfo

Summary

by MITRE • 07/25/2026

In the Linux kernel, the following vulnerability has been resolved:

writeback: fix race between cgroup_writeback_umount() and inode_switch_wbs()

When a container exits, the following BUG_ON() is occasionally triggered:

================================================================== VFS: Busy inodes after unmount of sdb (ext4) ------------[ cut here ]------------
kernel BUG at fs/super.c:695! CPU: 3 PID: 6 Comm: containerd-shim Tainted: G OE K 6.6 #1 pstate: 63400009 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--) pc : generic_shutdown_super+0xf0/0x100 lr : generic_shutdown_super+0xf0/0x100 Call trace: generic_shutdown_super+0xf0/0x100 kill_block_super+0x20/0x48 ext4_kill_sb+0x28/0x60 deactivate_locked_super+0x54/0x130 deactivate_super+0x84/0xa0 cleanup_mnt+0xa4/0x140 __cleanup_mnt+0x18/0x28 task_work_run+0x78/0xe0 do_notify_resume+0x204/0x240 ==================================================================

The root cause is a race between cgroup_writeback_umount() and inode_switch_wbs()/cleanup_offline_cgwb(). There is a window between inode_prepare_wbs_switch() returning true and the subsequent wb_queue_isw() call. Following is the process that triggers the issue:

CPU A (umount) | CPU B (writeback) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inode_switch_wbs/cleanup_offline_cgwb atomic_inc(&isw_nr_in_flight) inode_prepare_wbs_switch -> passes SB_ACTIVE check __iget(inode) generic_shutdown_super sb->s_flags &= ~SB_ACTIVE cgroup_writeback_umount(sb) smp_mb() atomic_read(&isw_nr_in_flight) rcu_barrier() -> no pending RCU callbacks flush_workqueue(isw_wq) -> nothing queued, returns evict_inodes(sb) -> Inode skipped as isw still holds a ref. sop->put_super(sb) /* destroys percpu counters */ -> VFS: Busy inodes after unmount! wb_queue_isw() queue_work(isw_wq, ...) /* later in work function */ inode_switch_wbs_work_fn process_inode_switch_wbs iput() -> evict percpu_counter_dec() // UAF!

Fix this by extending the RCU read-side critical section in inode_switch_wbs() and cleanup_offline_cgwb() to cover from inode_prepare_wbs_switch() through wb_queue_isw(). Since there is no sleep in this window, rcu_read_lock() can be used. Then add a synchronize_rcu() in cgroup_writeback_umount() before the existing rcu_barrier(), so that all in-flight switchers that have passed the SB_ACTIVE check have completed queue_work() before flush_workqueue() is called.

The existing rcu_barrier() is intentionally retained so this fix can be backported unchanged to stable kernels (5.10.y, 6.6.y, ...) that still queue switches via queue_rcu_work(). It is a no-op on current mainline (since commit e1b849cfa6b6 ("writeback: Avoid contention on wb->list_lock when switching inodes")) and is removed in a follow-up patch.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 07/25/2026

The vulnerability described relates to a race condition in the Linux kernel's writeback subsystem that occurs during container shutdown and filesystem unmount operations. This issue manifests as a kernel BUG_ON() trigger when a container exits, leading to potential system instability or crash. The problem arises from an improper synchronization mechanism between two kernel threads involved in managing inode writeback operations within cgroup contexts.

The technical flaw stems from a race condition between the functions cgroup_writeback_umount() and inode_switch_wbs() during filesystem cleanup. Specifically, there exists a temporal window where inode_prepare_wbs_switch() returns true indicating that an inode switch can proceed, but before wb_queue_isw() is called to queue the work, another thread may be attempting to unmount the filesystem. This scenario creates a situation where inodes are still referenced by active writeback operations while the filesystem is being torn down, resulting in the "VFS: Busy inodes after unmount" error message.

The operational impact of this vulnerability is significant for containerized environments and systems relying on dynamic filesystem management. When containers exit or filesystems are unmounted, the kernel's inability to properly coordinate writeback operations leads to resource leaks and potential system crashes. The race condition can cause the kernel to hang indefinitely during cleanup operations, as inodes remain referenced while the filesystem structure is being destroyed.

The fix implemented involves extending the RCU read-side critical section to encompass the entire window between inode_prepare_wbs_switch() and wb_queue_isw(). This approach uses rcu_read_lock() to prevent premature RCU grace periods from completing while writeback operations are in progress. Additionally, a synchronize_rcu() call is added to cgroup_writeback_umount() before the existing rcu_barrier(), ensuring all in-flight inode switchers that have passed the SB_ACTIVE check complete their queue_work() calls before flush_workqueue() proceeds. This solution addresses the core synchronization problem while maintaining backward compatibility with older kernel versions.

This vulnerability aligns with CWE-362, which describes a race condition where two or more threads access shared data concurrently and at least one of the accesses is a write operation. The mitigation strategy follows ATT&CK technique T1547.001 for privilege escalation through kernel exploitation and T1059.003 for execution through system commands, as the improper synchronization can lead to unauthorized system state modifications during critical operations. The fix ensures proper ordering of operations in the writeback subsystem and prevents use-after-free conditions that could be exploited by malicious actors.

The solution maintains compatibility with stable kernel releases by preserving the existing rcu_barrier() call while adding the necessary synchronization primitives. This approach allows the same patch to be applied to multiple kernel versions including 5.10.y, 6.6.y, and other maintenance branches without requiring version-specific modifications. The fix specifically targets the writeback subsystem's handling of per-cpu counters and inode reference management during filesystem unmount operations, preventing the corruption of kernel data structures that could lead to system crashes or security vulnerabilities.

The implementation addresses a fundamental synchronization issue in the Linux kernel's file system layer that affects containerized environments where dynamic resource allocation and deallocation occur frequently. By extending the critical section and adding proper RCU synchronization, the vulnerability is resolved without introducing performance regressions or breaking existing functionality. This approach ensures that inode writeback operations complete properly before filesystem cleanup begins, maintaining kernel stability in high-concurrency scenarios involving container orchestration platforms.

Responsible

Linux

Reservation

07/19/2026

Disclosure

07/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00215

KEV

no

Activities

low

Sources

Want to know what is going to be exploited?

We predict KEV entries!