# CVE-2022-49052: mm: fix unexpected zeroed page mapping with zram swap

- Severity: High 7.1 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.29%, higher than 23% of CVEs (2026-12-01)
- Published: 2025-02-26T01:54:26.322Z
- Modified: 2026-08-05T08:53:36.785Z
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

mm: fix unexpected zeroed page mapping with zram swap

Two processes under CLONE_VM cloning, user process can be corrupted by
seeing zeroed page unexpectedly.

      CPU A                        CPU B

  do_swap_page                do_swap_page
  SWP_SYNCHRONOUS_IO path     SWP_SYNCHRONOUS_IO path
  swap_readpage valid data
    swap_slot_free_notify
      delete zram entry
                              swap_readpage zeroed(invalid) data
                              pte_lock
                              map the *zero data* to userspace
                              pte_unlock
  pte_lock
  if (!pte_same)
    goto out_nomap;
  pte_unlock
  return and next refault will
  read zeroed data

The swap_slot_free_notify is bogus for CLONE_VM case since it doesn't
increase the refcount of swap slot at copy_mm so it couldn't catch up
whether it's safe or not to discard data from backing device.  In the
case, only the lock it could rely on to synchronize swap slot freeing is
page table lock.  Thus, this patch gets rid of the swap_slot_free_notify
function.  With this patch, CPU A will see correct data.

      CPU A                        CPU B

  do_swap_page                do_swap_page
  SWP_SYNCHRONOUS_IO path     SWP_SYNCHRONOUS_IO path
                              swap_readpage original data
                              pte_lock
                              map the original data
                              swap_free
                                swap_range_free
                                  bd_disk->fops->swap_slot_free_notify
  swap_readpage read zeroed data
                              pte_unlock
  pte_lock
  if (!pte_same)
    goto out_nomap;
  pte_unlock
  return
  on next refault will see mapped data by CPU B

The concern of the patch would increase memory consumption since it
could keep wasted memory with compressed form in zram as well as
uncompressed form in address space.  However, most of cases of zram uses
no readahead and do_swap_page is followed by swap_free so it will free
the compressed form from in zram quickly.

(As written by CVE List.)

## Affected

- Linux Linux: from 0bcac06f27d7528591c27ac2b093ccd71c5d0168 before f86d55cf616199404c05f5b0c5c41b17351baa02; from 0bcac06f27d7528591c27ac2b093ccd71c5d0168 before f098f8b9820fe3f2e41aefc4329dfe8a3859d1c1; from 0bcac06f27d7528591c27ac2b093ccd71c5d0168 before 20ed94f8181a25212e7404e44958e234f407624b; from 0bcac06f27d7528591c27ac2b093ccd71c5d0168 before 12ba1d38115a101c45d8e0ca3aa1181fd148e57f; from 0bcac06f27d7528591c27ac2b093ccd71c5d0168 before afac4b88699a06c8b9369f9d759a1ec3c254b788; from 0bcac06f27d7528591c27ac2b093ccd71c5d0168 before e914d8f00391520ecc4495dd0ca0124538ab7119; 4.15 (not affected: before 4.15; from 4.19.242 up to 4.19.*; from 5.4.193 up to 5.4.*; from 5.10.112 up to 5.10.*; from 5.15.35 up to 5.15.*; from 5.17.4 up to 5.17.*; from 5.18 up to *)
- linux linux_kernel: from 4.15 before 4.19.242; from 4.20 before 5.4.193; from 5.5 before 5.10.112; from 5.11 before 5.15.35; from 5.16 before 5.17.4; 5.18

## Every score

- Linux: CVSS:3.1 7.1 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/f86d55cf616199404c05f5b0c5c41b17351baa02> (patch)
- <https://git.kernel.org/stable/c/f098f8b9820fe3f2e41aefc4329dfe8a3859d1c1> (patch)
- <https://git.kernel.org/stable/c/20ed94f8181a25212e7404e44958e234f407624b> (patch)
- <https://git.kernel.org/stable/c/12ba1d38115a101c45d8e0ca3aa1181fd148e57f> (patch)
- <https://git.kernel.org/stable/c/afac4b88699a06c8b9369f9d759a1ec3c254b788> (patch)
- <https://git.kernel.org/stable/c/e914d8f00391520ecc4495dd0ca0124538ab7119> (patch)

## Sources

- CVE List: [CVE-2022-49052](https://www.cve.org/CVERecord?id=CVE-2022-49052), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2022-49052](https://nvd.nist.gov/vuln/detail/CVE-2022-49052), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2022-49052 · Whole record: https://cve.day/CVE-2022-49052.json · Rebuilt by cve.day 2026-11-25T22:58:20.121Z
