Skip to contentSkip to conversation

CVE-2026-53129: fs/mbcache: cancel shrink work before destroying the cache

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jun 24

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

fs/mbcache: cancel shrink work before destroying the cache

mb_cache_destroy() calls shrinker_free() and then frees all cache entries and the cache itself, but it does not cancel the pending c_shrink_work work item first.

If mb_cache_entry_create() schedules c_shrink_work via schedule_work() and the work item is still pending or running when mb_cache_destroy() runs, mb_cache_shrink_worker() will access the cache after its memory has been freed, causing a use-after-free.

This is only reachable by a privileged user (root or CAP_SYS_ADMIN) who can trigger the last put of a mounted ext2/ext4/ocfs2 filesystem.

Cancel the work item with cancel_work_sync() before calling shrinker_free(), ensuring the worker has finished and will not be rescheduled before the cache is torn down.

The Linux kernel CVE team has assigned CVE-2026-53129 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 4.6 with commit c2f3140fe2eceb3a6c1615b2648b9471544881c6 and fixed in 6.12.91 with commit a88d39a74a208e197c03bffaa2df34de732af19f
	Issue introduced in 4.6 with commit c2f3140fe2eceb3a6c1615b2648b9471544881c6 and fixed in 6.18.33 with commit 0e4eff315d799f5842b95872199b0f0fb8ef5f51
	Issue introduced in 4.6 with commit c2f3140fe2eceb3a6c1615b2648b9471544881c6 and fixed in 7.0.10 with commit b25fd3523bef88fb7ffd4c5b63bbe9c08f73bb4c
	Issue introduced in 4.6 with commit c2f3140fe2eceb3a6c1615b2648b9471544881c6 and fixed in 7.1 with commit d227786ab1119669df4dc333a61510c52047cce4

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-53129

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
fs/mbcache.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/a88d39a74a208e197c03bffaa2df34de732af19f
	https://git.kernel.org/stable/c/0e4eff315d799f5842b95872199b0f0fb8ef5f51
	https://git.kernel.org/stable/c/b25fd3523bef88fb7ffd4c5b63bbe9c08f73bb4c
	https://git.kernel.org/stable/c/d227786ab1119669df4dc333a61510c52047cce4