CVE-2026-143169: mm/page_alloc: keep the pagesets of an empty zone
In the Linux kernel, the following vulnerability has been resolved:
mm/pagealloc: keep the pagesets of an empty zone
When the last memory of a zone goes offline, zonepcpreset() frees zone->percpupageset and zone->percpuzonestats. Nothing waits for those who found the zone populated and still use the two pointers. They take neither the memory hotplug lock nor any other lock which offlinepages() holds, and some of them can sleep:
CPU0 vmstatupdate() CPU1 offlinepages() refreshcpuvmstats() foreachpopulatedzone(zone) pcp = zone->percpupageset condresched() adjustpresentpagecount() zonepcpreset(zone) freepercpu(zone->percpupageset) decaypcphigh(zone, pcp) thiscpuwrite(pcp->expire, 0)
The same goes for drainallpages(NULL), which takes pcp->lock, for zonepcpupdate(), showfreeareas() and the readers and writers of the zonestats. If the per-cpu memory has got a new owner in the meantime, it is corrupted.
The pagesets are only freed because setupzonepageset() would otherwise leak them when the zone gets memory again. Keep them instead and let setupzonepageset() and zonepcpinit() use them again, like it is done with pgdat->percpunodestats. Their lists are empty, and their limits have been calculated for a zone without memory by the initperzonewmarkmin() of offlinepages(), which is what setupzonepageset() would come up with as well.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7
Event History
Frequently Asked Questions
Under what operating condition can this race occur?
It can occur when the last memory in a zone is taken offline while other execution contexts still hold or access that zone's per-CPU pageset or zone-statistics pointers. Those contexts do not necessarily hold the memory-hotplug lock used by offline_pages().
Which concurrent activities are implicated?
The affected users include vmstat_update() through refresh_cpu_vm_stats(), drain_all_pages(NULL), zone_pcp_update(), show_free_areas(), and readers or writers of zone statistics. Some of these paths can sleep after obtaining the pageset pointer, widening the race window.
What is the potential impact if the race is hit?
The per-CPU pageset or zone-statistics memory can be freed while still in use. If that per-CPU allocation has been reassigned, subsequent accesses can corrupt its new owner's memory.
What does the resolved change do to prevent the issue?
Instead of freeing the pagesets and per-CPU zone statistics when a zone becomes empty, the change retains them for reuse if memory is later added back to the zone. This avoids invalidating pointers held by concurrent users.