CVE-2026-99668
published high CVSS 3.1 · 7.8mm/huge_memory: fix zapping migration entries for device-private THPs
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux368076f52ebeecd33e10a9f80905d7508b6b6149 to < 2d7e94a16d0d33ce2cce5ea06cf61079c392d351 · 368076f52ebeecd33e10a9f80905d7508b6b6149 to < 63a940541358d09cc9f02d40b71eb8d3917a21c0 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.19 (affected) · 0 to < 6.19 (unaffected · semver) · 7.3.5 through 7.3.* (unaffected · semver) · 7.4-rc2 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: mm/huge_memory: fix zapping migration entries for device-private THPs A PMD migration entry can refer to a device-private folio. zap_huge_pmd_folio() checks the folio type instead of the entry type, so it treats such a migration entry as a device-private entry. Installing the migration entry already removed the reverse mapping and dropped the mapping reference. Zapping it must not repeat those operations. Concurrent MADV_DONTNEED during migration back to system memory can trigger this. Check the PMD entry type using pmd_is_device_private_entry(). Fix generated by an LLM and sent by Chris Mason in private. [ david: simplify description ]
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - madvise(MADV_DONTNEED) reaches the buggy check in zap_huge_pmd_folio through do_madvise, madvise_dontneed_single_vma, zap_vma_range_batched and zap_pmd_range. The zapped PMD is a migration entry that set_pmd_migration_entry wrote into the caller's page tables during do_huge_pmd_device_private. AC:L - The attacker first moves their own anonymous THP to device-private memory through GPU HMM, then faults it so __handle_mm_fault calls do_huge_pmd_device_private and migrate_vma_setup. set_pmd_migration_entry leaves the migration PMD installed across the device-to-RAM copy, and a second thread of the same process calls MADV_DONTNEED into that window. PR:L - Both the fault and madvise run as an unprivileged process on an anonymous VMA it owns. GPU HMM drivers (nouveau_dmem_migrate_to_ram, svm_migrate_to_ram) install the device-private THP for a render-node client, and zap_huge_pmd_folio does not consult capabilities. UI:N - The attacker calls madvise and generates the migrate-back fault on a device-private THP mapping that their own process already created. S:U - The repeated folio_put and folio_remove_rmap_pmd corrupt the device-private folio in the calling kernel. The damaged state is that kernel's folio refcount and mapcount, the same authority as the vulnerable mm code. C:H - set_pmd_migration_entry already called folio_put to drop the mapping pin. zap_huge_pmd_folio takes the folio_is_device_private(folio) branch and puts again, so the refcount hits zero and free_zone_device_folio runs while do_huge_pmd_device_private still holds the folio and will folio_unlock and folio_put it. That is a use-after-free of the folio. I:H - The extra folio_put returns the device-private folio to the driver free list (nouveau_dmem_folio_free) while migration still has it locked, so the later folio_unlock and folio_put modify the lock and refcount of whatever client reallocates that folio. The extra folio_remove_rmap_pmd also writes a negative _large_mapcount and underflows _nr_pages_mapped. A:H - free_zone_device_folio drops a folio that migrate_vma_finalize and do_huge_pmd_device_private still lock and put, which oopses the kernel or unlocks a live reallocated folio. The second folio_remove_rmap_pmd also feeds a huge negative delta, nr_pages plus ENTIRELY_MAPPED, into __folio_mod_stat.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 368076f52ebeecd33e10a9f80905d7508b6b6149 to < 2d7e94a16d0d33ce2cce5ea06cf61079c392d351 (affected · git)368076f52ebeecd33e10a9f80905d7508b6b6149 to < 63a940541358d09cc9f02d40b71eb8d3917a21c0 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.19 (affected)0 to < 6.19 (unaffected · semver)7.3.5 through 7.3.* (unaffected · semver)7.4-rc2 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
2Provider assertions
1Linux · cna
mm/huge_memory: fix zapping migration entries for device-private THPs
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 8a944a6cb5253c8c031b0a38d0db97cd8186032b7e0864d4d1341219187a33cd
- Ingested
- 23 Nov 2026, 14:37:13 UTC
- Source record
- Official CVE record