Linux
mm/percpu-km: fix bitmap overflow and accounting in pcpu_create_chunk()
In the Linux kernel, the following vulnerability has been resolved: mm/percpu-km: fix bitmap overflow and accounting in pcpu_create_chunk() In pcpu_create_chunk(), nr_pages is the total contiguous backing allocation, i.e., nr_units * pcpu_unit_pages, but pcpu_chunk_populated() uses it to set chunk->populated, whose size is pcpu_unit_pages, bitmap. Since bit N in chunk->populated means page offset N inside every unit is backed. When nr_units > 1, the function writes beyond chunk->populated. Fix it by using chunk->nr_pages. It also fixes the global pcpu_nr_empty_pop_pages accounting, since pcpu_balance_free() 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 pcpu_nr_empty_pop_pages and chunk->nr_populated") added pcpu_nr_empty_pop_pages and caused the accounting issue.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= a63d4ac4ab6094c051a5a240260d16117a7a2f86, < 5f43d2c1bea280dcdfabaf156c25e7402fb8039f
- >= a63d4ac4ab6094c051a5a240260d16117a7a2f86, < 92c43ac3c2b09eb16162e8144e73c00b7c3e29d6
- >= a63d4ac4ab6094c051a5a240260d16117a7a2f86, < 6fc7da2a052f2825fff785e860e67183f5acaaba
- >= a63d4ac4ab6094c051a5a240260d16117a7a2f86, < 01504da375f5b19df195cb1cb1cf1dd184318f97
- >= a63d4ac4ab6094c051a5a240260d16117a7a2f86, < a6940b84c8c035da465b7165fdfcfb005545724e
- >= a63d4ac4ab6094c051a5a240260d16117a7a2f86, < 32134cf9211b83bed9076d0739c5906fbea4c763
- >= a63d4ac4ab6094c051a5a240260d16117a7a2f86, < 5c7fc39bf19abb38a996aaad77b3e3a8f48581c3
- >= a63d4ac4ab6094c051a5a240260d16117a7a2f86, < 89b1b79c308818a715e75f28744b70d8940a07c9
Fixed in 5f43d2c1bea280dcdfabaf156c25e7402fb8039f, 92c43ac3c2b09eb16162e8144e73c00b7c3e29d6, 6fc7da2a052f2825fff785e860e67183f5acaaba, 01504da375f5b19df195cb1cb1cf1dd184318f97, a6940b84c8c035da465b7165fdfcfb005545724e, 32134cf9211b83bed9076d0739c5906fbea4c763, 5c7fc39bf19abb38a996aaad77b3e3a8f48581c3, 89b1b79c308818a715e75f28744b70d8940a07c9
- 3.18
Fixed in 0, 5.10.265, 5.15.216, 6.1.183, 6.6.151, 6.12.103, 6.18.44, 7.1.8, 7.2
Mitigation
Upgrade Linux to 5f43d2c1bea280dcdfabaf156c25e7402fb8039f or 92c43ac3c2b09eb16162e8144e73c00b7c3e29d6 or 6fc7da2a052f2825fff785e860e67183f5acaaba or 01504da375f5b19df195cb1cb1cf1dd184318f97 or a6940b84c8c035da465b7165fdfcfb005545724e or 32134cf9211b83bed9076d0739c5906fbea4c763 or 5c7fc39bf19abb38a996aaad77b3e3a8f48581c3 or 89b1b79c308818a715e75f28744b70d8940a07c9 or later.
Upgrade Linux to 0 or 5.10.265 or 5.15.216 or 6.1.183 or 6.6.151 or 6.12.103 or 6.18.44 or 7.1.8 or 7.2 or later.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.