CVE-2025-38242

MEDIUMNVD 4.74.7
EchelonGraph scoreMEDIUM confidence

Score 4.7 from GitHub Security Advisory published 2025-07-09. NVD baseline CVSS 4.7; sources differ by 0.0.

Triggered by: GitHub Security Advisory CVSS
Sources: epss, ghsa, nvd
Trending — 3 sources updated this week
4.7
EchelonGraph verdictMonitorLow exploitation likelihood right now — keep watching.
  • Lower severity and no public exploit yet
CISA-KEV: Not listedEPSS: 0%CVSS: 4.7Exploit: NoneExposed: 0

A fix is available — apply it.

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

mm: userfaultfd: fix race of userfaultfd_move and swap cache

This commit fixes two kinds of races, they may have different results:

Barry reported a BUG_ON in commit c50f8e6053b0, we may see the same BUG_ON if the filemap lookup returned NULL and folio is added to swap cache after that.

If another kind of race is triggered (folio changed after lookup) we may see RSS counter is corrupted:

[ 406.893936] BUG: Bad rss-counter state mm:ffff0000c5a9ddc0 type:MM_ANONPAGES val:-1 [ 406.894071] BUG: Bad rss-counter state mm:ffff0000c5a9ddc0 type:MM_SHMEMPAGES val:1

Because the folio is being accounted to the wrong VMA.

I'm not sure if there will be any data corruption though, seems no. The issues above are critical already.

On seeing a swap entry PTE, userfaultfd_move does a lockless swap cache lookup, and tries to move the found folio to the faulting vma. Currently, it relies on checking the PTE value to ensure that the moved folio still belongs to the src swap entry and that no new folio has been added to the swap cache, which turns out to be unreliable.

While working and reviewing the swap table series with Barry, following existing races are observed and reproduced [1]:

In the example below, move_pages_pte is moving src_pte to dst_pte, where src_pte is a swap entry PTE holding swap entry S1, and S1 is not in the swap cache:

CPU1 CPU2 userfaultfd_move move_pages_pte() entry = pte_to_swp_entry(orig_src_pte); // Here it got entry = S1 ... < interrupted> ... // folio A is a new allocated folio // and get installed into src_pte // src_pte now points to folio A, S1 // has swap count == 0, it can be freed // by folio_swap_swap or swap // allocator's reclaim. // folio B is a folio in another VMA. // S1 is freed, folio B can use it // for swap out with no problem. ... folio = filemap_get_folio(S1) // Got folio B here !!! ... < interrupted again> ... // Now S1 is free to be used again. // Now src_pte is a swap entry PTE // holding S1 again. folio_trylock(folio) move_swap_pte double_pt_lock is_pte_pages_stable // Check passed because src_pte == S1 folio_move_anon_rmap(...) // Moved invalid folio B here !!!

The race window is very short and requires multiple collisions of multiple rare events, so it's very unlikely to happen, but with a deliberately constructed reproducer and increased time window, it can be reproduced easily.

This can be fixed by checking if the folio returned by filemap is the valid swap cache folio after acquiring the folio lock.

Another similar race is possible: filemap_get_folio may return NULL, but folio (A) could be swapped in and then swapped out again using the same swap entry after the lookup. In such a case, folio (A) may remain in the swap cache, so it must be moved too:

CPU1 CPU2 userfaultfd_move move_pages_pte() entry = pte_to_swp_entry(orig_src_pte); // Here it got entry = S1, and S1 is not in swap cache folio = filemap_get ---truncated---

CVSS v3
4.7
EG Score
4.7(medium)
EG Risk
26(Track)
EG Risk 26/100SSVC: Track

EG Risk is EchelonGraph's 0–100 priority score: it fuses intrinsic severity with real-world exploitation and automatability so you can rank equal-severity CVEs and fix the most dangerous first. Higher = act sooner. Distinct from the 0–10 EG Score (severity).

How it’s computed
Severity47% × 45%
Exploitation0% × 40%
Automatability30% × 15%
Action: Routine — remediate on your standard cadence.
EPSS
1.2%
KEV
Not listed

Published

July 9, 2025

Last Modified

November 19, 2025

Patch Availability(7)

Patches are aggregated from vendor advisories (Red Hat, Microsoft, Cisco, GitHub) and package ecosystems (OSV, GHSA). Multiple rows for the same upstream release have been deduplicated.

Weakness Classification(1)

MITRE Common Weakness Enumeration — the root-cause categories this CVE belongs to.

All Vendor Advisories

(6)

Data Freshness Timeline

(refreshed 11× in last 7d / 39× in last 30d)

Each row is a source pipeline that fetched or updated this CVE on that date, with what changed. For example, "NVD update" means NVD published or revised its analysis for this CVE; "MITRE cvelistV5" means we ingested or refreshed it from the CNA feed. Most recent first.

  1. 2026-07-24 14:17 UTCEPSS rescore
  2. 2026-07-24 01:11 UTCOSV refresh
  3. 2026-07-23 02:54 UTCEG score recompute
  4. 2026-07-22 14:07 UTCEPSS rescore
  5. 2026-07-22 14:07 UTCEPSS rescore
  6. 2026-07-21 15:24 UTCEPSS rescore
  7. 2026-07-20 17:07 UTCEPSS rescore
  8. 2026-07-19 14:30 UTCEPSS rescore
  9. 2026-07-19 14:30 UTCEPSS rescore
  10. 2026-07-18 10:04 UTCEPSS rescore
  11. 2026-07-18 10:04 UTCEPSS rescore
  12. 2026-07-16 17:02 UTCEPSS rescore
  13. 2026-07-15 16:57 UTCEPSS rescore
  14. 2026-07-15 16:57 UTCEPSS rescore
  15. 2026-07-15 01:59 UTCEPSS rescore
  16. 2026-07-15 01:59 UTCEPSS rescore
  17. 2026-07-13 22:29 UTCEPSS rescore
  18. 2026-07-13 22:29 UTCEPSS rescore
  19. 2026-07-13 06:12 UTCEPSS rescore
  20. 2026-07-12 05:46 UTCEPSS rescore
  21. 2026-07-09 19:09 UTCEPSS rescore
  22. 2026-07-09 19:09 UTCEPSS rescore
  23. 2026-07-07 13:45 UTCEPSS rescore
  24. 2026-07-06 19:19 UTCOSV refresh
  25. 2026-07-06 16:27 UTCEPSS rescore
Show 55 more
  1. 2026-07-06 16:27 UTCEPSS rescore
  2. 2026-07-06 02:23 UTCEPSS rescore
  3. 2026-07-05 02:30 UTCEPSS rescore
  4. 2026-07-04 06:30 UTCEPSS rescore
  5. 2026-07-01 15:06 UTCEPSS rescore
  6. 2026-07-01 15:06 UTCEPSS rescore
  7. 2026-06-30 23:22 UTCEPSS rescore
  8. 2026-06-30 23:22 UTCEPSS rescore
  9. 2026-06-28 14:07 UTCEPSS rescore
  10. 2026-06-28 14:07 UTCEPSS rescore
  11. 2026-06-28 04:55 UTCEPSS rescore
  12. 2026-06-28 04:55 UTCEPSS rescore
  13. 2026-06-27 03:08 UTCEPSS rescore
  14. 2026-06-27 03:08 UTCEPSS rescore
  15. 2026-06-24 14:04 UTCEPSS rescore
  16. 2026-06-24 14:04 UTCEPSS rescore
  17. 2026-06-23 21:32 UTCEPSS rescore
  18. 2026-06-23 21:32 UTCEPSS rescore
  19. 2026-06-21 14:56 UTCEPSS rescore
  20. 2026-06-21 14:56 UTCEPSS rescore
  21. 2026-06-19 19:25 UTCEPSS rescore
  22. 2026-06-19 19:25 UTCEPSS rescore
  23. 2026-06-18 17:52 UTCEPSS rescore
  24. 2026-06-18 17:52 UTCEPSS rescore
  25. 2026-06-18 07:43 UTCOSV refresh
  26. 2026-06-17 17:52 UTCEPSS rescore
  27. 2026-06-16 17:52 UTCEPSS rescore
  28. 2026-06-16 17:52 UTCEPSS rescore
  29. 2026-06-14 23:17 UTCEPSS rescore
  30. 2026-06-13 23:00 UTCEPSS rescore
  31. 2026-06-12 23:11 UTCEPSS rescore
  32. 2026-06-11 14:00 UTCEPSS rescore
  33. 2026-06-10 22:18 UTCEPSS rescore
  34. 2026-06-10 13:22 UTCEPSS rescore
  35. 2026-06-08 14:16 UTCEPSS rescore
  36. 2026-06-08 14:16 UTCEPSS rescore
  37. 2026-06-07 15:24 UTCEPSS rescore
  38. 2026-06-06 13:47 UTCEPSS rescore
  39. 2026-06-06 13:47 UTCEPSS rescore
  40. 2026-06-05 22:46 UTCEPSS rescore
  41. 2026-06-05 22:46 UTCEPSS rescore
  42. 2026-06-05 06:10 UTCEPSS rescore
  43. 2026-06-05 06:10 UTCEPSS rescore
  44. 2026-06-04 13:12 UTCEPSS rescore
  45. 2026-06-04 13:12 UTCEPSS rescore
  46. 2026-06-02 20:12 UTCEPSS rescore
  47. 2026-06-01 13:51 UTCEPSS rescore
  48. 2026-06-01 13:51 UTCEPSS rescore
  49. 2026-05-31 22:30 UTCEPSS rescore
  50. 2026-05-31 22:30 UTCEPSS rescore
  51. 2026-05-31 00:16 UTCEPSS rescore
  52. 2026-05-30 02:13 UTCEG score recompute
  53. 2026-05-30 02:13 UTCVendor advisory
  54. 2026-05-30 02:13 UTCGHSA enrichment
  55. 2026-05-29 13:44 UTCEPSS rescore

Frequently asked(5)

What is CVE-2025-38242?
CVE-2025-38242 is a medium vulnerability published on July 9, 2025. In the Linux kernel, the following vulnerability has been resolved: mm: userfaultfd: fix race of userfaultfd_move and swap cache This commit fixes two kinds of races, they may have different results: Barry reported a BUG_ON in commit c50f8e6053b0, we may see the same BUG_ON if the filemap lookup…
When was CVE-2025-38242 disclosed?
CVE-2025-38242 was first published in the National Vulnerability Database on July 9, 2025, with the most recent update on November 19, 2025. EchelonGraph re-ingests CVE updates from NVD on a 2-hour cycle, so this page reflects the latest published state.
Is CVE-2025-38242 actively exploited?
CVE-2025-38242 is not currently on CISA's Known Exploited Vulnerabilities catalog. FIRST EPSS estimates a 1.2% percentile likelihood of exploitation in the next 30 days — higher percentiles indicate greater predicted risk.
What is the CVSS score of CVE-2025-38242?
CVE-2025-38242 has a CVSS v3 base score of 4.7 (NVD).
How do I remediate CVE-2025-38242?
Patch to the fixed version published by the affected vendor. Where vendor advisories exist for CVE-2025-38242, EchelonGraph cross-links them in the Vendor Advisories panel below — those typically contain the canonical remediation steps, fixed version numbers, and any vendor-specific mitigations.

Dependency Blast Radius

Explore the affected products and dependency analysis for CVE-2025-38242

Explore →

Is Your Infrastructure Affected by CVE-2025-38242?

EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.