
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2024-26759 is a race condition vulnerability in the Linux kernel's memory management subsystem, specifically in the swap cache handling mechanism. The vulnerability was discovered in early 2024 and affects the Linux kernel's memory management when skipping swapcache for SWP_SYNCHRONOUS_IO operations (Kernel Git).
The vulnerability occurs when two or more threads attempt to swap in the same entry simultaneously, resulting in different pages (A, B) being allocated. The race condition manifests when one thread (T0) hasn't finished installing page A to the PTE while another thread (T1) completes swapping in page B, frees the entry, and potentially reuses it for swap out. This breaks the pte_same check because the PTE value remains unchanged, leading to an ABA problem where thread T0 installs a stale page A into the PTE (Kernel Git).
The vulnerability can lead to data corruption and potential data loss. For ZRAM devices, the issue is particularly severe as swap_free() allows the swap device to discard entry content, potentially causing data loss even if page B is not modified. The issue has been demonstrated to cause data loss in test environments with a reproduction rate of approximately once every 5 minutes (Kernel Git).
The vulnerability can be reliably triggered using a specially constructed reproducer that spawns multiple threads sharing the same memory region with a small swap device. The reproducer demonstrates the race condition by having pairs of threads update mapped pages in opposite directions while a dedicated thread continuously swaps out data using madvise (Kernel Git).
The issue has been fixed by implementing a solution that reuses swapcache_prepare to pin the swap entry using the cache flag. This ensures only one thread can swap it in and prevents parallel code from putting the entry in the cache. The fix includes releasing the pin after PT unlock and adding a schedule_timeout_uninterruptible(1) call to prevent repeated page faults from wasting CPU resources (Kernel Git).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."