CVE-2025-38242
BaseFortify
Publication date: 2025-07-09
Last updated on: 2025-11-19
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | 6.16 |
| linux | linux_kernel | 6.16 |
| linux | linux_kernel | 6.16 |
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-362 | The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability in the Linux kernel involves a race condition in the userfaultfd subsystem related to moving swap cache entries. Specifically, there are timing issues when the system tries to move memory pages (folios) between virtual memory areas (VMAs) during swap operations. Due to these races, the system may incorrectly associate memory pages with the wrong VMAs, leading to corrupted RSS counters and potential kernel bugs. The race occurs because the code relies on checking page table entries (PTEs) without proper locking, which can result in using stale or invalid swap cache entries. Although the race window is very short and requires rare conditions, it can be reproduced with deliberate effort. The fix involves adding proper validation and locking when accessing swap cache folios to ensure correctness.
How can this vulnerability impact me? :
This vulnerability can cause kernel bugs such as corrupted RSS counters and BUG_ON errors, which may lead to system instability or crashes. While it is unclear if data corruption occurs, the incorrect accounting of memory pages to VMAs can affect system memory management reliability. Exploiting this race condition could potentially disrupt normal system operations, especially in environments with heavy memory swapping and userfaultfd usage.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability may manifest as kernel BUG_ON messages related to bad rss-counter state, such as logs containing 'BUG: Bad rss-counter state mm:ffff...' indicating corrupted RSS counters. Detection involves monitoring kernel logs (e.g., using 'dmesg' or 'journalctl -k') for such BUG_ON messages. Specific commands to check kernel logs include: 'dmesg | grep -i bug', 'journalctl -k | grep -i bug', or monitoring for anomalies in memory management related logs. There are no specific network detection commands since this is a kernel memory management race condition.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation involves updating the Linux kernel to a version where this race condition in userfaultfd_move and swap cache has been fixed. Since the issue is a race condition in kernel memory management, applying the patch or upgrading to the fixed kernel version is necessary. There are no configuration workarounds or temporary fixes mentioned.