In the Linux kernel, the following vulnerability has been resolved:
mm/percpu-km: fix bitmap overflow and accounting in pcpucreatechunk()
In pcpucreatechunk(), nrpages is the total contiguous backing allocation, i.e., nrunits * pcpuunitpages, but pcpuchunkpopulated() uses it to set chunk->populated, whose size is pcpuunitpages, bitmap. Since bit N in chunk->populated means page offset N inside every unit is backed. When nrunits > 1, the function writes beyond chunk->populated. Fix it by using chunk->nrpages.
It also fixes the global pcpunremptypoppages accounting, since pcpubalancefree() only iterates up to chunk->nr_pages.
Commit a63d4ac4ab609 ("percpu: make percpu-km set chunk->populated bitmap properly") introduced the bitmap overflow issue. Later, commit b539b87fed37f ("percpu: implmeent pcpunremptypoppages and chunk->nrpopulated") added pcpunremptypop_pages and caused the accounting issue.