CVE-2024-0564: Kernel: max page sharing of kernel samepage merging (ksm) may cause memory deduplication
A flaw has been discovered in the Linux kernel memory deduplication mechanism.
Previous research has shown that memory deduplication can be attacked by exploiting the Copy-on-Write (COW) mechanism.
However, the max page sharing[1] of Kernel Samepage Merging (KSM), added in Linux kernel version 4.4.0-96.119, can create another side channel.
When the attacker and the victim share the same host and the default setting of KSM is "max page sharing=256", the attacker maps 256 memory of the same pages it wants to learn and waits. He can then time the unmap to see if it merges with the victim's page.
The reason the unmapping time depends on whether it merges with the victim's page is that additional physical pages are created beyond the KSM's "max page share".
Through these operations, the attacker leaks the victim's page.
We have confirmed that the target Linux kernel versions are 4.4.0-96.119 through 5.15.0-58-generic, and we expect later versions to be possible.
The research, titled "Exploiting Memory Page Management in KSM for Remote Memory Deduplication Attack," was presented at The 24th World Conference on Information Security Applications (WISA), 2023 [2] and will be published by Springer this year [3].
- Reference - [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1680513 [2] https://wisa.or.kr/accepted [3] https://link.springer.com/conference/wisa
Other sources
A flaw was found in the Linux kernel's memory deduplication mechanism. The max page sharing of Kernel Samepage Merging (KSM), added in Linux kernel version 4.4.0-96.119, can create a side channel. When the attacker and the victim share the same host and the default setting of KSM is "max page sharing=256", it is possible for the attacker to time the unmap to merge with the victim's page. The unmapping time depends on whether it merges with the victim's page and additional physical pages are created beyond the KSM's "max page share". Through these operations, the attacker can leak the victim's page.
— NVD
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2024-0564?
CVE-2024-0564 is considered a high severity vulnerability due to its potential to exploit the memory deduplication mechanism in the Linux kernel.
How does the CVE-2024-0564 vulnerability affect systems?
CVE-2024-0564 can potentially allow an attacker to exploit the Copy-on-Write (COW) mechanism to gain unauthorized access or execute arbitrary code.
How do I fix CVE-2024-0564?
To fix CVE-2024-0564, it is recommended to update the Linux kernel to version 5.15.0-58 or later, or ensure you are using the latest patches provided by your distribution.
Which Linux distributions are affected by CVE-2024-0564?
CVE-2024-0564 impacts multiple Linux distributions, specifically those using Linux kernel versions from 4.4.0-96.119 up to 5.15.0-58, including Red Hat Enterprise Linux 8.0 and 9.0.
Is there a workaround for CVE-2024-0564?
Currently, there are no specific workarounds for CVE-2024-0564 aside from applying the recommended kernel updates as they become available.