CVE-2026-64419: mm/shrinker: do not hold RCU lock in shrinker_debugfs_count_show()

Published Jul 25, 2026
·
Updated

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

mm/shrinker: do not hold RCU lock in shrinkerdebugfscountshow()

Reading the debugfs "count" file of a memcg-aware shrinker can sleep inside an RCU read-side critical section:

BUG: sleeping function called from invalid context at kernel/cgroup/rstat.c:421 RCU nest depth: 1, expected: 0 cssrstatflush memcgroupflushstats zswapshrinkercount shrinkerdebugfscountshow

shrinkerdebugfscountshow() invokes the ->countobjects() callback under rcureadlock(). The zswap callback flushes memcg stats via cssrstatflush(), which may sleep, so it must not run under RCU.

The RCU lock is not needed here. memcgroupiter() takes RCU internally and returns a memcg holding a css reference (dropped on the next iteration or by memcgroupiterbreak()), so the memcg stays alive without it. The shrinker is kept alive by the open debugfs file: shrinkerfree() removes the debugfs entries via debugfsremoverecursive(), which waits for in-flight readers to drain, before callrcu(..., shrinkerfreercucb). The sibling "scan" handler already invokes the sleeping ->scanobjects() callback with no RCU section.

Drop the rcureadlock()/rcureadunlock().

Affected Software

6 affected components
Linux Kernel
Linux Linux kernel>=6.0<6.1.178
Linux Linux kernel>=6.2<6.6.145
Linux Linux kernel>=6.7<6.12.96
Linux Linux kernel>=6.13<6.18.39
Linux Linux kernel>=6.19<7.1.4

Event History

Jul 25, 2026
CVE Published
via MITRE·08:50 AM
Data Sourced
via MITRE·08:50 AM
Description
Data Sourced
via NVD·10:17 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Systems are exposed when a user can read the debugfs "count" file for a memcg-aware shrinker. The described failing path involves the zswap shrinker, whose count callback can flush memory-cgroup statistics.

2

What does an attacker or local user need to do to trigger it?

They need local access sufficient to read the affected shrinker debugfs "count" file. Reading that file can invoke the shrinker's count callback while an RCU read-side critical section is held.

3

How can I tell whether the issue has occurred?

Kernel logs may report "BUG: sleeping function called from invalid context" and show an RCU nesting depth of 1. The reported stack includes css_rstat_flush, mem_cgroup_flush_stats, zswap_shrinker_count, and shrinker_debugfs_count_show.

4

What should I do if I cannot patch immediately?

Avoid reading the debugfs "count" file for memcg-aware shrinkers, particularly where it invokes the zswap shrinker count callback. A patch is available.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203