mm/migrate: report RCU-tasks quiescent states in migrate_pages_batch()
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 6.1.188, 6.6.157, 6.12.109, 6.18.50, 7.2.4
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
In the Linux kernel, the following vulnerability has been resolved: mm/migrate: report RCU-tasks quiescent states in migrate_pages_batch() migrate_pages_batch() unmaps each folio before moving it, and every unmap runs the mmu_notifier invalidate callbacks. On KVM hosts try_to_migrate() ends up in kvm_mmu_notifier_invalidate_range_start() -> tdp_mmu_zap_leafs(), which is expensive, so unmapping a large batch keeps the CPU busy for a long time. The loop already calls cond_resched(), but on PREEMPTION kernels that is a no-op, and involuntary preemption is not a Tasks-RCU quiescent state. A long batch therefore never reports a quiescent state, and the migrating task (e.g. kcompactd) becomes a Tasks-RCU holdout, stalling the Tasks-RCU grace period for minutes, which is common at Meta fleet: INFO: rcu_tasks detected stalls on tasks: 0000000055349ecc: .. nvcsw: 1157401/1157401 holdout: 1 idle_cpu: -1/56 task:kcompactd0 state:R running task Call Trace: tdp_mmu_zap_leafs tdp_mmu_next_root gfn_to_pfn_cache_invalidate_start kvm_mmu_notifier_invalidate_range_start __mmu_notifier_invalidate_range_start try_to_migrate_one try_to_migrate migrate_pages_batch migrate_pages compact_zone compact_node kcompactd kthread Use cond_resched_tasks_rcu_qs() so a quiescent state is reported even when cond_resched() does nothing. This has also been discussed at [1]
Timeline
- CVE published
- Record last updated
Affected versions
- Linux Linux
From 8315f42295d2667a7f942f154b73a86fd7cb2227 · fixed in 8c6d63d434ebb85c6cf3dac1e70a171b183c6614; From 8315f42295d2667a7f942f154b73a86fd7cb2227 · fixed in 4757542649af56d894e25e30f57cd497dffad53f; From 8315f42295d2667a7f942f154b73a86fd7cb2227 · fixed in 4996a7bc01ef35570664854dac2530c604981039; From 8315f42295d2667a7f942f154b73a86fd7cb2227 · fixed in 5dc0daff0341c6baba19c38f47d299ac831d7e99; From 8315f42295d2667a7f942f154b73a86fd7cb2227 · fixed in 66734981b4d3c105223a13c827c9c73be18d91ad; From 8315f42295d2667a7f942f154b73a86fd7cb2227 · fixed in efe8f86c0916f0f74eea74ae21a3b37f728c6bad
- Linux Linux
3.18
- KernelLinux
From 3.18.0 · fixed in 6.1.188; From 6.2.0 · fixed in 6.6.157; From 6.7.0 · fixed in 6.12.109; From 6.13.0 · fixed in 6.18.50; From 6.19.0 · fixed in 7.2.4