{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-49052","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2025-02-26T01:49:39.242Z","datePublished":"2025-02-26T01:54:26.322Z","dateUpdated":"2026-08-05T08:53:36.785Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T08:53:36.785Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: fix unexpected zeroed page mapping with zram swap\n\nTwo processes under CLONE_VM cloning, user process can be corrupted by\nseeing zeroed page unexpectedly.\n\n      CPU A                        CPU B\n\n  do_swap_page                do_swap_page\n  SWP_SYNCHRONOUS_IO path     SWP_SYNCHRONOUS_IO path\n  swap_readpage valid data\n    swap_slot_free_notify\n      delete zram entry\n                              swap_readpage zeroed(invalid) data\n                              pte_lock\n                              map the *zero data* to userspace\n                              pte_unlock\n  pte_lock\n  if (!pte_same)\n    goto out_nomap;\n  pte_unlock\n  return and next refault will\n  read zeroed data\n\nThe swap_slot_free_notify is bogus for CLONE_VM case since it doesn't\nincrease the refcount of swap slot at copy_mm so it couldn't catch up\nwhether it's safe or not to discard data from backing device.  In the\ncase, only the lock it could rely on to synchronize swap slot freeing is\npage table lock.  Thus, this patch gets rid of the swap_slot_free_notify\nfunction.  With this patch, CPU A will see correct data.\n\n      CPU A                        CPU B\n\n  do_swap_page                do_swap_page\n  SWP_SYNCHRONOUS_IO path     SWP_SYNCHRONOUS_IO path\n                              swap_readpage original data\n                              pte_lock\n                              map the original data\n                              swap_free\n                                swap_range_free\n                                  bd_disk->fops->swap_slot_free_notify\n  swap_readpage read zeroed data\n                              pte_unlock\n  pte_lock\n  if (!pte_same)\n    goto out_nomap;\n  pte_unlock\n  return\n  on next refault will see mapped data by CPU B\n\nThe concern of the patch would increase memory consumption since it\ncould keep wasted memory with compressed form in zram as well as\nuncompressed form in address space.  However, most of cases of zram uses\nno readahead and do_swap_page is followed by swap_free so it will free\nthe compressed form from in zram quickly."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","baseScore":7.1,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The bug is reached only through the local anonymous page-fault path (el0 fault → handle_mm_fault → do_swap_page → swap_readpage → zram), which an unprivileged process exercises by touching its own swapped pages; it is not reachable from network protocol handlers or physical device I/O.\nAC:L - An attacker who creates CLONE_VM threads, forces their anon pages into zram swap, and faults the same PTE from both CPUs fully controls both sides of the race; the public reproducer triggers it reliably, so success does not depend on conditions outside the attacker’s influence.\nPR:L - Any unprivileged local user can clone with CLONE_VM, allocate memory, and induce swap faults; swapon/zram setup needs CAP_SYS_ADMIN but is a pre-existing deployment condition (e.g. Android), not a privilege the attacker must hold.\nUI:N - The attacker triggers the race solely by running their own multi-threaded process under memory pressure; no separate victim action such as mounting a filesystem or opening a crafted file is required.\nS:U - Impact stays within the local kernel/process memory authority (wrong PTE contents for the shared mm); there is no VM escape, IOMMU bypass, or other cross-boundary effect.\nC:N - After the premature zram_slot_free_notify, the second swap_readpage sees a cleared handle and zram_read_from_zspool fills the page with zeros; the swap slot is not returned to the free pool until later swap_free, so this does not disclose other processes’ data.\nI:H - The race maps full pages of zeros over valid anonymous memory in a shared mm, permanently corrupting userspace state (observed as zeroed pointers and RocksDB on-disk corruption); that is total loss of integrity for the affected process memory.\nA:H - Corrupted pages cause process crashes/coredumps and service failures under zram swap pressure, denying availability of the affected multi-threaded workloads; when scoring between limited disruption and hard failure, High is appropriate."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/page_io.c"],"versions":[{"version":"0bcac06f27d7528591c27ac2b093ccd71c5d0168","lessThan":"f86d55cf616199404c05f5b0c5c41b17351baa02","status":"affected","versionType":"git"},{"version":"0bcac06f27d7528591c27ac2b093ccd71c5d0168","lessThan":"f098f8b9820fe3f2e41aefc4329dfe8a3859d1c1","status":"affected","versionType":"git"},{"version":"0bcac06f27d7528591c27ac2b093ccd71c5d0168","lessThan":"20ed94f8181a25212e7404e44958e234f407624b","status":"affected","versionType":"git"},{"version":"0bcac06f27d7528591c27ac2b093ccd71c5d0168","lessThan":"12ba1d38115a101c45d8e0ca3aa1181fd148e57f","status":"affected","versionType":"git"},{"version":"0bcac06f27d7528591c27ac2b093ccd71c5d0168","lessThan":"afac4b88699a06c8b9369f9d759a1ec3c254b788","status":"affected","versionType":"git"},{"version":"0bcac06f27d7528591c27ac2b093ccd71c5d0168","lessThan":"e914d8f00391520ecc4495dd0ca0124538ab7119","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/page_io.c"],"versions":[{"version":"4.15","status":"affected"},{"version":"0","lessThan":"4.15","status":"unaffected","versionType":"semver"},{"version":"4.19.242","lessThanOrEqual":"4.19.*","status":"unaffected","versionType":"semver"},{"version":"5.4.193","lessThanOrEqual":"5.4.*","status":"unaffected","versionType":"semver"},{"version":"5.10.112","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.35","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"5.17.4","lessThanOrEqual":"5.17.*","status":"unaffected","versionType":"semver"},{"version":"5.18","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":"4.15","versionEndExcluding":"4.19.242"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"5.4.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"5.10.112"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"5.15.35"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"5.17.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"5.18"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/f86d55cf616199404c05f5b0c5c41b17351baa02"},{"url":"https://git.kernel.org/stable/c/f098f8b9820fe3f2e41aefc4329dfe8a3859d1c1"},{"url":"https://git.kernel.org/stable/c/20ed94f8181a25212e7404e44958e234f407624b"},{"url":"https://git.kernel.org/stable/c/12ba1d38115a101c45d8e0ca3aa1181fd148e57f"},{"url":"https://git.kernel.org/stable/c/afac4b88699a06c8b9369f9d759a1ec3c254b788"},{"url":"https://git.kernel.org/stable/c/e914d8f00391520ecc4495dd0ca0124538ab7119"}],"title":"mm: fix unexpected zeroed page mapping with zram swap","x_generator":{"engine":"bippy-1.2.0"}}}}