Description
In the Linux kernel, the following vulnerability has been resolved: mm/page_alloc: keep the pagesets of an empty zone When the last memory of a zone goes offline, zone_pcp_reset() frees zone->per_cpu_pageset and zone->per_cpu_zonestats. 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 offline_pages() holds, and some of them can sleep: CPU0 vmstat_update() CPU1 offline_pages() refresh_cpu_vm_stats() for_each_populated_zone(zone) pcp = zone->per_cpu_pageset cond_resched() adjust_present_page_count() zone_pcp_reset(zone) free_percpu(zone->per_cpu_pageset) decay_pcp_high(zone, pcp) __this_cpu_write(pcp->expire, 0) The same goes for drain_all_pages(NULL), which takes pcp->lock, for zone_pcp_update(), show_free_areas() 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 setup_zone_pageset() would otherwise leak them when the zone gets memory again. Keep them instead and let setup_zone_pageset() and zone_pcp_init() use them again, like it is done with pgdat->per_cpu_nodestats. Their lists are empty, and their limits have been calculated for a zone without memory by the init_per_zone_wmark_min() of offline_pages(), which is what setup_zone_pageset() would come up with as well.
Affected products
Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.
Linux Linux
Default version status: unaffected
340175b7d14d5617559d0c1a54fa0ea204d9edcd to < 2be9a0b3daed689f328de80019fc125af4ca27c0affected340175b7d14d5617559d0c1a54fa0ea204d9edcd to < f6ebb3ee0ac9abb01e628238e2d5369b2de00ad3affected340175b7d14d5617559d0c1a54fa0ea204d9edcd to < dc7501fe9cc9053b9ed24d9f299e6a6af297e4caaffected340175b7d14d5617559d0c1a54fa0ea204d9edcd to < 7bfcf81b1cb469bc016fa8e07939c0924b9ff8dbaffected
Linux Linux
Default version status: affected
3.6affected0 to < 3.6unaffected6.12.120 to ≤ 6.12.*unaffected6.18.66 to ≤ 6.18.*unaffected7.3.7 to ≤ 7.3.*unaffected7.4-rc3 to ≤ *unaffected