Linux
fs/mbcache: cancel shrink work before destroying the cache
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= c2f3140fe2eceb3a6c1615b2648b9471544881c6, < 40148c615687c1692712e50a6de53d62dfbfc20f
- >= c2f3140fe2eceb3a6c1615b2648b9471544881c6, < cbdd6f0fb19a0ce8a013acd80ac87a62f57fa20d
- >= c2f3140fe2eceb3a6c1615b2648b9471544881c6, < a88d39a74a208e197c03bffaa2df34de732af19f
- >= c2f3140fe2eceb3a6c1615b2648b9471544881c6, < 0e4eff315d799f5842b95872199b0f0fb8ef5f51
- >= c2f3140fe2eceb3a6c1615b2648b9471544881c6, < b25fd3523bef88fb7ffd4c5b63bbe9c08f73bb4c
- >= c2f3140fe2eceb3a6c1615b2648b9471544881c6, < d227786ab1119669df4dc333a61510c52047cce4
Fixed in 40148c615687c1692712e50a6de53d62dfbfc20f, cbdd6f0fb19a0ce8a013acd80ac87a62f57fa20d, a88d39a74a208e197c03bffaa2df34de732af19f, 0e4eff315d799f5842b95872199b0f0fb8ef5f51, b25fd3523bef88fb7ffd4c5b63bbe9c08f73bb4c, d227786ab1119669df4dc333a61510c52047cce4
- 4.6
Fixed in 0, 6.1.191, 6.6.160, 6.12.91, 6.18.33, 7.0.10, 7.1
Mitigation
Upgrade Linux to 40148c615687c1692712e50a6de53d62dfbfc20f or cbdd6f0fb19a0ce8a013acd80ac87a62f57fa20d or a88d39a74a208e197c03bffaa2df34de732af19f or 0e4eff315d799f5842b95872199b0f0fb8ef5f51 or b25fd3523bef88fb7ffd4c5b63bbe9c08f73bb4c or d227786ab1119669df4dc333a61510c52047cce4 or later.
Upgrade Linux to 0 or 6.1.191 or 6.6.160 or 6.12.91 or 6.18.33 or 7.0.10 or 7.1 or later.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.