{"id":"CVE-2024-36943","state":"PUBLISHED","title":"fs/proc/task_mmu: fix loss of young/dirty bits during pagemap scan","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/proc/task_mmu: fix loss of young/dirty bits during pagemap scan\n\nmake_uffd_wp_pte() was previously doing:\n\n  pte = ptep_get(ptep);\n  ptep_modify_prot_start(ptep);\n  pte = pte_mkuffd_wp(pte);\n  ptep_modify_prot_commit(ptep, pte);\n\nBut if another thread accessed or dirtied the pte between the first 2\ncalls, this could lead to loss of that information.  Since\nptep_modify_prot_start() gets and clears atomically, the following is the\ncorrect pattern and prevents any possible race.  Any access after the\nfirst call would see an invalid pte and cause a fault:\n\n  pte = ptep_modify_prot_start(ptep);\n  pte = pte_mkuffd_wp(pte);\n  ptep_modify_prot_commit(ptep, pte);","publishedAt":"2024-05-30T15:35:42.119Z","updatedAt":"2026-08-05T11:32:11.488Z","severity":{"score":7.3,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"52526ca7fdb905a768a93f8faa418e9b988fc34b","status":"affected","lessThan":"74b3d66f91d9f539f99faad74d796fa9a389a015","versionType":"git"},{"version":"52526ca7fdb905a768a93f8faa418e9b988fc34b","status":"affected","lessThan":"c70dce4982ce1718bf978a35f8e26160b82081f4","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/proc/task_mmu.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.7","versionType":"semver"},{"version":"6.8.10","status":"unaffected","lessThanOrEqual":"6.8.*","versionType":"semver"},{"version":"6.9","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/proc/task_mmu.c"]}],"references":["https://git.kernel.org/stable/c/74b3d66f91d9f539f99faad74d796fa9a389a015","https://git.kernel.org/stable/c/c70dce4982ce1718bf978a35f8e26160b82081f4"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:30.303Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/36xxx/CVE-2024-36943.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-36943","state":"PUBLISHED","datePublished":"2024-05-30T15:35:42.119Z","dateUpdated":"2026-08-05T11:32:11.488Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-05-30T15:25:07.073Z"},"containers":{"cna":{"title":"fs/proc/task_mmu: fix loss of young/dirty bits during pagemap scan","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/proc/task_mmu: fix loss of young/dirty bits during pagemap scan\n\nmake_uffd_wp_pte() was previously doing:\n\n  pte = ptep_get(ptep);\n  ptep_modify_prot_start(ptep);\n  pte = pte_mkuffd_wp(pte);\n  ptep_modify_prot_commit(ptep, pte);\n\nBut if another thread accessed or dirtied the pte between the first 2\ncalls, this could lead to loss of that information.  Since\nptep_modify_prot_start() gets and clears atomically, the following is the\ncorrect pattern and prevents any possible race.  Any access after the\nfirst call would see an invalid pte and cause a fault:\n\n  pte = ptep_modify_prot_start(ptep);\n  pte = pte_mkuffd_wp(pte);\n  ptep_modify_prot_commit(ptep, pte);"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"52526ca7fdb905a768a93f8faa418e9b988fc34b","status":"affected","lessThan":"74b3d66f91d9f539f99faad74d796fa9a389a015","versionType":"git"},{"version":"52526ca7fdb905a768a93f8faa418e9b988fc34b","status":"affected","lessThan":"c70dce4982ce1718bf978a35f8e26160b82081f4","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/proc/task_mmu.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.7","versionType":"semver"},{"version":"6.8.10","status":"unaffected","lessThanOrEqual":"6.8.*","versionType":"semver"},{"version":"6.9","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/proc/task_mmu.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/74b3d66f91d9f539f99faad74d796fa9a389a015"},{"url":"https://git.kernel.org/stable/c/c70dce4982ce1718bf978a35f8e26160b82081f4"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H","baseScore":7.3,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerability is reached only through the PAGEMAP_SCAN ioctl on /proc/<pid>/pagemap combined with a userfaultfd WP-async registration, both of which require local execution on the host. There is no network-facing consumer of this path.\nAC:L - The attacker owns both sides of the race — sibling threads continuously writing to the mapped range set the hardware A/D bits while another thread loops PAGEMAP_SCAN with PM_SCAN_WP_MATCHING over millions of PTEs per iteration, so a hit is effectively guaranteed and can be retried without limit. No condition depends on external state the attacker cannot influence.\nPR:L - Only an ordinary unprivileged local account is needed: pagemap_open() requires just PTRACE_MODE_READ (trivial for /proc/self), the PAGEMAP_SCAN ioctl has no capability check, and userfaultfd_syscall_allowed() unconditionally permits UFFD_USER_MODE_ONLY so even vm.unprivileged_userfaultfd=0 does not block UFFD_FEATURE_WP_ASYNC registration. All required Kconfig options (PROC_PAGE_MONITOR, PTE_MARKER_UFFD_WP) are default-y in distro kernels.\nUI:N - The attacker drives the ioctl and the racing writes entirely from its own threads with no victim action required; when targeting another mm the victim's pre-existing uffd-wp-async registration is passive state, not an interaction.\nS:U - The lost PTE bits corrupt memory managed by the same kernel that contains the flaw, with no crossing of a hypervisor, IOMMU, or sandbox boundary. This is the standard unchanged-scope case for a kernel memory-management defect.\nC:L - Discarding the dirty bit causes a page's rewritten contents to be dropped and the stale swap-slot contents to be resurrected, so data a process deliberately overwrote or scrubbed (keys, credentials) persists in memory and on the swap device instead of being erased. This is a bounded exposure of previously-written data rather than an arbitrary kernel read primitive.\nI:H - Loss of the dirty bit makes the kernel silently drop modified pages — swap-cached anonymous pages revert to stale contents and MADV_FREE pages are discarded to zeros via the try_to_unmap_one discard path — with no error to the application. The attacker can repeat this across an unbounded number of pages, including in another process's mm it can ptrace-read (e.g. a CRIU- or VMM-managed workload using uffd-wp-async dirty tracking), amounting to total loss of integrity of that memory.\nA:H - Pages silently reverting to stale swap contents or being zeroed out corrupts live program state and reliably renders the affected process — including a targeted uffd-wp-async user such as a checkpoint/restore agent or live-migration VMM and its guest — non-functional or crashed. The condition is repeatable at will by an unprivileged local user."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:32:11.488Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.7","versionEndExcluding":"6.8.10"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.7","versionEndExcluding":"6.9"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2024-06-05T18:15:10.001170Z","id":"CVE-2024-36943","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-06-05T18:17:48.241Z"}},{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/74b3d66f91d9f539f99faad74d796fa9a389a015","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/c70dce4982ce1718bf978a35f8e26160b82081f4","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-02T03:43:50.375Z"}}]}}}