{"id":"CVE-2026-72043","aliases":["CVE-2026-72043"],"related":[],"kind":"vulnerability","state":"published","title":"LoongArch: Fix missing dirty page tracking in {pte,pmd}_wrprotect()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: Fix missing dirty page tracking in {pte,pmd}_wrprotect()\n\nWhen hardware page table walker (PTW) is enabled on LoongArch, the CPU\nmay set _PAGE_DIRTY directly in the page table entry during a write TLB\nmiss, without going through the software TLB store handler. The software\nTLB store handler (tlbex.S:254) sets both _PAGE_DIRTY and_PAGE_MODIFIED\ntogether:\n\n    ori t0, t0, (_PAGE_VALID | _PAGE_DIRTY | _PAGE_MODIFIED)\n\nSince hardware PTW only sets _PAGE_DIRTY, the software-only bit, i.e.\n_PAGE_MODIFIED is left unchanged. This creates a window where a PTE has\n_PAGE_DIRTY set (hardware knows the page is dirty) but _PAGE_MODIFIED\nclear (software is unaware).\n\nWhen fork()/clone() triggers copy-on-write, __copy_present_ptes() calls\npte_wrprotect(), which unconditionally clears both the _PAGE_WRITE and\n_PAGE_DIRTY bits:\n\n    pte_val(pte) &= ~(_PAGE_WRITE | _PAGE_DIRTY);\n\nSince _PAGE_MODIFIED was never set, the dirtiness information is lost\ncompletely. Subsequently, when memory pressure triggers page reclaim,\npage_mkclean() / try_to_unmap() sees the page as clean (i.e. pte_dirty()\nreturns false) and the page may be freed without writeback, causing data\ncorruption.\n\nFix this by propagating the _PAGE_DIRTY bit to the _PAGE_MODIFIED bit in\nboth pte_wrprotect() and pmd_wrprotect() before clearing writeable bits:\n\n    if (pte_val(pte) & _PAGE_DIRTY)\n        pte_val(pte) |= _PAGE_MODIFIED;\n\nThe pmd_wrprotect() fix handles the CONFIG_TRANSPARENT_HUGEPAGE case,\nwhere pmd entries need the same treatment.\n\nThis ensures the software dirty tracking bit (checked by pte_dirty() and\npmd_dirty(), which read both the _PAGE_DIRTY and _PAGE_MODIFIED bits) is\npreserved across fork COW write-protection.\n\nThe issue was found by the LTP madvise09 test case, which exercises page\nreclaim after \"madvise(MADV_FREE), write and fork\" operation sequence on\nprivate anonymous mappings.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: Fix missing dirty page tracking in {pte,pmd}_wrprotect()\n\nWhen hardware page table walker (PTW) is enabled on LoongArch, the CPU\nmay set _PAGE_DIRTY directly in the page table entry during a write TLB\nmiss, without going through the software TLB store handler. The software\nTLB store handler (tlbex.S:254) sets both _PAGE_DIRTY and_PAGE_MODIFIED\ntogether:\n\n    ori t0, t0, (_PAGE_VALID | _PAGE_DIRTY | _PAGE_MODIFIED)\n\nSince hardware PTW only sets _PAGE_DIRTY, the software-only bit, i.e.\n_PAGE_MODIFIED is left unchanged. This creates a window where a PTE has\n_PAGE_DIRTY set (hardware knows the page is dirty) but _PAGE_MODIFIED\nclear (software is unaware).\n\nWhen fork()/clone() triggers copy-on-write, __copy_present_ptes() calls\npte_wrprotect(), which unconditionally clears both the _PAGE_WRITE and\n_PAGE_DIRTY bits:\n\n    pte_val(pte) &= ~(_PAGE_WRITE | _PAGE_DIRTY);\n\nSince _PAGE_MODIFIED was never set, the dirtiness information is lost\ncompletely. Subsequently, when memory pressure triggers page reclaim,\npage_mkclean() / try_to_unmap() sees the page as clean (i.e. pte_dirty()\nreturns false) and the page may be freed without writeback, causing data\ncorruption.\n\nFix this by propagating the _PAGE_DIRTY bit to the _PAGE_MODIFIED bit in\nboth pte_wrprotect() and pmd_wrprotect() before clearing writeable bits:\n\n    if (pte_val(pte) & _PAGE_DIRTY)\n        pte_val(pte) |= _PAGE_MODIFIED;\n\nThe pmd_wrprotect() fix handles the CONFIG_TRANSPARENT_HUGEPAGE case,\nwhere pmd entries need the same treatment.\n\nThis ensures the software dirty tracking bit (checked by pte_dirty() and\npmd_dirty(), which read both the _PAGE_DIRTY and _PAGE_MODIFIED bits) is\npreserved across fork COW write-protection.\n\nThe issue was found by the LTP madvise09 test case, which exercises page\nreclaim after \"madvise(MADV_FREE), write and fork\" operation sequence on\nprivate anonymous mappings.","source":"cvelist"}],"published":"2026-08-15T05:52:02.505Z","modified":"2026-08-17T06:18:02.257Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":7.1,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"09cfefb7fa70c3af011b0db0a513fd80b2f18abc","fixed":"76f88650763a35cbf1384c65d66d096fa31cc58d","status":"affected"},{"type":"git","introduced":"09cfefb7fa70c3af011b0db0a513fd80b2f18abc","fixed":"e8a916579e427af32f2de8213dfa23c5df6e6664","status":"affected"},{"type":"git","introduced":"09cfefb7fa70c3af011b0db0a513fd80b2f18abc","fixed":"39bb21a4bff0d70058bf752d7b5aa2e2ccc864a9","status":"affected"},{"type":"git","introduced":"09cfefb7fa70c3af011b0db0a513fd80b2f18abc","fixed":"a65f49b6f7ece756394f8f0e85570020e7fd0e35","status":"affected"},{"type":"git","introduced":"09cfefb7fa70c3af011b0db0a513fd80b2f18abc","fixed":"e483da960892c41fa7f0cf0d2fc2410d65a483d6","status":"affected"},{"type":"git","introduced":"09cfefb7fa70c3af011b0db0a513fd80b2f18abc","fixed":"018e9828eb523c638fa3d9bdf0fd4956b74555b2","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.19","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.19","status":"unaffected"},{"type":"semver","introduced":"6.1.178","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.145","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.97","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.40","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.1.5","lastAffected":"7.1.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.2","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/76f88650763a35cbf1384c65d66d096fa31cc58d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e8a916579e427af32f2de8213dfa23c5df6e6664","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/39bb21a4bff0d70058bf752d7b5aa2e2ccc864a9","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a65f49b6f7ece756394f8f0e85570020e7fd0e35","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e483da960892c41fa7f0cf0d2fc2410d65a483d6","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/018e9828eb523c638fa3d9bdf0fd4956b74555b2","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-72043","url":"https://www.cve.org/CVERecord?id=CVE-2026-72043","licence":"CVE Terms of Use","modified":"2026-08-17T05:39:42.678Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-72043","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-72043","licence":"Public domain","modified":"2026-08-17T06:18:02.257Z"}],"updatedAt":"2026-11-25T22:59:32.984Z","epss":{"score":0.0016,"percentile":0.05462,"date":"2026-12-01T12:00:22.000Z"}}