CVE-2024-0564

Public Exploit
Kernel: max page sharing of kernel samepage merging (ksm) may cause memory deduplication

Description

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.

Remediation

Workaround:

  • The mitigation shown below has a potentially significant impact on system performance and stability. It should be carefully tested prior to deployment: - Deactivation of memory deduplication Deactivating memory deduplication will effectively mitigate all attack vectors. This measure unfortunately eliminates all the highly appreciated benefits of memory deduplication, namely the increase of operational cost-effectiveness through inter-VM memory sharing. This will cause an increase in the amount of memory required and in some situations may adversely impact performance (e.g. due to slower swap space being used). It is recommended that customers test this workaround before using it in production. See https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_tuning_and_optimization_guide/sect-ksm-deactivating_ksm for how to disable KSM from Red Hat Enterprise Linux 6 and newer. - Disabling services and firewall rules. The attack uses the response time of services on the system. By limiting access to services an attacker must connect to the service to successful carry out the exploit. Reducing the number of systems that are allowed to connect to the service will prevent an attack from working when launched outside an allowed ranges. While this does not prevent an attack from working, it will reduce the amount of systems that an attacker can launch an attack from.

Category

5.3
CVSS
Severity: Medium
CVSS 3.1 •
EPSS 0.02%
Third-Party Advisory redhat.com
Affected: Red Hat Red Hat Enterprise Linux 6
Affected: Red Hat Red Hat Enterprise Linux 7
Affected: Red Hat Red Hat Enterprise Linux 7
Affected: Red Hat Red Hat Enterprise Linux 8
Affected: Red Hat Red Hat Enterprise Linux 8
Affected: Red Hat Red Hat Enterprise Linux 9
Affected: Red Hat Red Hat Enterprise Linux 9
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2024-0564?
CVE-2024-0564 has been scored as a medium severity vulnerability.
How to fix CVE-2024-0564?
As a workaround for remediating CVE-2024-0564: The mitigation shown below has a potentially significant impact on system performance and stability. It should be carefully tested prior to deployment: - Deactivation of memory deduplication Deactivating memory deduplication will effectively mitigate all attack vectors. This measure unfortunately eliminates all the highly appreciated benefits of memory deduplication, namely the increase of operational cost-effectiveness through inter-VM memory sharing. This will cause an increase in the amount of memory required and in some situations may adversely impact performance (e.g. due to slower swap space being used). It is recommended that customers test this workaround before using it in production. See https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_tuning_and_optimization_guide/sect-ksm-deactivating_ksm for how to disable KSM from Red Hat Enterprise Linux 6 and newer. - Disabling services and firewall rules. The attack uses the response time of services on the system. By limiting access to services an attacker must connect to the service to successful carry out the exploit. Reducing the number of systems that are allowed to connect to the service will prevent an attack from working when launched outside an allowed ranges. While this does not prevent an attack from working, it will reduce the amount of systems that an attacker can launch an attack from.
Is CVE-2024-0564 being actively exploited in the wild?
It is possible that CVE-2024-0564 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2024-0564?
CVE-2024-0564 affects Red Hat Red Hat Enterprise Linux 6, Red Hat Red Hat Enterprise Linux 7, Red Hat Red Hat Enterprise Linux 7, Red Hat Red Hat Enterprise Linux 8, Red Hat Red Hat Enterprise Linux 8, Red Hat Red Hat Enterprise Linux 9, Red Hat Red Hat Enterprise Linux 9.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.