{"id":"CVE-2026-98939","summary":"x86/mm: Drop unnecessary PMD page copy when freeing","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nx86/mm: Drop unnecessary PMD page copy when freeing\n\nOn a box with a discrete GPU, lockdep reports a possible deadlock as\nsoon as kswapd shrinks the TTM page pool. The immediate cause is an\nx86 commit that added an mmap_read_lock() to kernel page protection\nmunging code.\n\nThe huge vmap code holds the same lock over a GFP_KERNEL allocation,\nwhich is a no-no now that reclaim can take it. That allocation is in a\npage table *free* path and ends up being for dubious purposes[1].\nBasically, it tries to avoid hardware setting Accessed=1 in page table\nentries that are unreachable by the hardware, a non-issue.\n\nRemove the PMD copy. Detach the original PMD page at the PUD, flush\nthe mid-level caches, and free the PTE tables straight from the\ndetached PMD page. With no allocation left, the locking issue is gone.\n\nLockdep splat/analysis:\n\n  WARNING: possible circular locking dependency detected\n  7.3.0-rc3-f6e7b42bf05b+ #183 Tainted: G     U\n  ------------------------------------------------------\n  kswapd0/269 is trying to acquire lock:\n  ((init_mm).mmap_lock){++++}-{4:4}, at: change_page_attr_set_clr+0x29a/0x4a0\n  but task is already holding lock:\n  (pool_shrink_rwsem){.+.+}-{4:4}, at: ttm_pool_shrink+0xb2/0x330 [ttm]\n  Chain exists of:\n    (init_mm).mmap_lock --\u003e fs_reclaim --\u003e pool_shrink_rwsem\n\nThe cycle is built from three edges:\n\n  1) pool_shrink_rwsem -\u003e (init_mm).mmap_lock\n\n     The TTM shrinker restores the caching attribute of every page it\n     frees, while holding pool_shrink_rwsem:\n\n       ttm_pool_shrink()\n       -\u003e ttm_pool_dispose_list()\n       -\u003e ttm_pool_free_page()\n       -\u003e set_pages_wb()\n       -\u003e change_page_attr_set_clr()   [ init_mm mmap read lock ]\n\n  2) fs_reclaim -\u003e pool_shrink_rwsem\n\n     The same shrinker, called from reclaim.\n\n  3) (init_mm).mmap_lock -\u003e fs_reclaim\n\n     ioremap() installing a huge PUD mapping over an existing PMD table:\n\n       ioremap_page_range()\n       -\u003e vmap_range_noflush()\n       -\u003e vmap_try_huge_pud()          [ init_mm mmap read lock ]\n       -\u003e pud_free_pmd_page()\n       -\u003e __get_free_page(GFP_KERNEL)  [ enters reclaim ]\n\n[ dhansen: Lots of changelog munging/trimming and merged comments from my\n\t   version of the fix. ]","modified":"2026-10-25T02:47:29.812401818Z","published":"2026-10-23T12:12:06.180Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/98xxx/CVE-2026-98939.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/d3c2d2692bdf4af94bb27bc7a3aa0a348a567606"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e3ee38c1bc0b11a8d3e63dce7050759b61864286"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f38c57a28ebbd057471573e39555d5aa11ab03cf"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/98xxx/CVE-2026-98939.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-98939"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"e21a9ea81426a85fdb0cdcfcc99d5d9c16b402ab"},{"fixed":"d3c2d2692bdf4af94bb27bc7a3aa0a348a567606"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"cc73b2043d106b467accd38e9b1fc09e0607c056"},{"fixed":"f38c57a28ebbd057471573e39555d5aa11ab03cf"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"d5d8b8662e6e5a565b47a0388640e88402f23274"},{"fixed":"e3ee38c1bc0b11a8d3e63dce7050759b61864286"}]}],"versions":["v6.18.55","v6.18.54","v6.18.53","v7.2.9","v7.2.8","v7.2.7"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-98939.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.18.53"},{"fixed":"6.18.56"}]},{"type":"ECOSYSTEM","events":[{"introduced":"7.2.7"},{"fixed":"7.2.10"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-98939.json"}}],"schema_version":"1.9.2"}