{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99669","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-09-25T10:25:14.428Z","datePublished":"2026-11-20T05:50:18.839Z","dateUpdated":"2026-11-22T11:09:34.256Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-11-22T11:09:34.256Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/huge_memory: fix truncate racing with PMD zapping\n\nzap_huge_pmd_folio() removes the rmap before calling folio_mark_dirty().\nIf this was the last mapping, truncation can skip unmapping the folio\nand proceed without waiting for the PMD lock, racing with dirtying.\n\nifs_set_range_dirty() can oops if MADV_DONTNEED races with\nftruncate() on XFS, when we get the folio set dirty after it was found\nto not be mapped anymore.\n\nMove folio_mark_dirty() and folio_mark_accessed() before rmap removal,\nmatching the PTE zap path. This keeps the folio mapped while updating\nits state, so truncation must wait for the page table lock.\n\nFix generated by an LLM and sent by Chris Mason in private.\n\n[ david: simplify comment and description ]"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - madvise(MADV_DONTNEED) on a local mapping reaches the bug: do_madvise() to madvise_dontneed_single_vma() to zap_vma_range_batched() to zap_pmd_range() to zap_huge_pmd() to zap_huge_pmd_folio(), which calls folio_remove_rmap_pmd() before folio_mark_dirty(). The paired ftruncate() is a local syscall on that same file; no remote protocol field supplies the triggering state.\nAC:L - The caller builds both sides: an XFS write allocates a PMD-order folio (iomap_get_folio() via fgf_set_order, then do_set_pmd() on fault), a store dirties the PMD, then one thread issues madvise(MADV_DONTNEED) while another issues ftruncate(). After folio_remove_rmap_pmd() clears the last mapcount, truncate_cleanup_folio() calls folio_invalidate()/ifs_free() and skips unmap_mapping_folio(), so zap_huge_pmd()'s PMD lock stays uncontended.\nPR:L - do_madvise() and do_ftruncate() need only a file the caller can write: do_ftruncate() requires FMODE_WRITE and vfs_truncate() checks inode_permission(MAY_WRITE). No capability is checked before zap_huge_pmd_folio() or xfs_vn_setattr_size().\nUI:N - The attacker mmaps, writes, and truncates a file they created, from threads they run. zap_huge_pmd_folio() races truncate_cleanup_folio() with no other user opening the file.\nS:U - The corrupted object is an iomap_folio_state in the same kernel that runs the attacker's madvise and ftruncate. zap_huge_pmd_folio() and ifs_free() execute in that host kernel, which is ordinary kernel privilege-escalation scope.\nC:H - ifs_set_range_dirty() loads ifs->state_lock and read-modify-writes ifs->state after ifs_free() has kfree'd that iomap_folio_state, while folio->mapping is still set (filemap_remove_folio() runs later in truncate_inode_folio()). Reusing the slab slot turns that use into a read and a corruption of a kernel object that can disclose memory.\nI:H - With a 2MB folio and 4K blocks, ifs_set_range_dirty() bitmap_set()s 512 bits (64 bytes of 0xff) at bit offset blks_per_folio in the freed iomap_folio_state and writes the spinlock word. That heap write overwrites a reallocated slab object.\nA:H - Using the kfree'd iomap_folio_state, or loading folio->mapping->host in ifs_set_range_dirty() after filemap_remove_folio() cleared it, oopses the kernel. That is the MADV_DONTNEED versus XFS ftruncate crash fixed by reordering zap_huge_pmd_folio()."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/huge_memory.c"],"versions":[{"version":"fe6cf984939d8e12cb33a99673c8d026c5135e68","lessThan":"a5786ec7ba7967433207f20214ff75768497a2c9","status":"affected","versionType":"git"},{"version":"fe6cf984939d8e12cb33a99673c8d026c5135e68","lessThan":"e6a07d29b0a60f3a4cfe77fe34eeb4b3fb38d6c4","status":"affected","versionType":"git"},{"version":"79d8c89baa10612c1675972a632c65cdbe0936f6","status":"affected","versionType":"git"},{"version":"13f4910d81b62a214cdb28b47237198fa96078a2","status":"affected","versionType":"git"},{"version":"7a4c3f7b47ba34b021a7747081f330bfb76a4271","status":"affected","versionType":"git"},{"version":"6e904f9e8cb0e39f60e1cdbea679f89346a563c2","status":"affected","versionType":"git"},{"version":"fd720d3906877b3d2118cd480027e4bc6648f0c5","status":"affected","versionType":"git"},{"version":"effe3cc6d4fdd407457eb30f7b0ef094393f0d64","status":"affected","versionType":"git"},{"version":"9435cddf1378d149d826bd7bd1448a44bf96868d","status":"affected","versionType":"git"},{"version":"5.10.273","lessThan":"5.11","status":"affected","versionType":"semver"},{"version":"5.15.224","lessThan":"5.16","status":"affected","versionType":"semver"},{"version":"6.1.191","lessThan":"6.2","status":"affected","versionType":"semver"},{"version":"6.6.160","lessThan":"6.7","status":"affected","versionType":"semver"},{"version":"6.12.114","lessThan":"6.13","status":"affected","versionType":"semver"},{"version":"6.18.52","lessThan":"6.19","status":"affected","versionType":"semver"},{"version":"7.2.5","lessThan":"7.3","status":"affected","versionType":"semver"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/huge_memory.c"],"versions":[{"version":"7.3","status":"affected"},{"version":"0","lessThan":"7.3","status":"unaffected","versionType":"semver"},{"version":"7.3.5","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc2","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.3","versionEndExcluding":"7.3.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.3","versionEndExcluding":"7.4-rc2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10.273"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15.224"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12.114"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18.52"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.2.5"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/a5786ec7ba7967433207f20214ff75768497a2c9"},{"url":"https://git.kernel.org/stable/c/e6a07d29b0a60f3a4cfe77fe34eeb4b3fb38d6c4"}],"title":"mm/huge_memory: fix truncate racing with PMD zapping","x_generator":{"engine":"bippy-1.2.0"}}}}