CVE-2021-3714
Description
A flaw was found in the Linux kernels memory deduplication mechanism. Previous work has shown that memory deduplication can be attacked via a local exploitation mechanism. The same technique can be used if an attacker can upload page sized files and detect the change in access time from a networked service to determine if the page has been merged.
Statement
This issue affects the versions of the Linux Kernel as shipped with Red Hat Enterprise Linux 6,7 and 8. Red Hat Product Security has rated this issue as having Moderate security impact. Additionally a workaround is available. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.
Mitigation
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.
Common Vulnerability Scoring System (CVSS) Score Details
Info alert:Important note
CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).
The following CVSS metrics and score provided are preliminary and subject to review.
CVSS v3 Score Breakdown
| Red Hat | NVD | cve.org | |
|---|---|---|---|
| Base Score | 5.9 | 5.9 | N/A |
| Attack Vector | Network | Network | N/A |
| Attack Complexity | High | High | N/A |
| Privileges Required | None | None | N/A |
| User Interaction | None | None | N/A |
| Scope | Unchanged | Unchanged | N/A |
| Confidentiality | High | High | N/A |
| Integrity Impact | None | None | N/A |
| Availability Impact | None | None | N/A |
Vector
Red Hat: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Red Hat CVSS v3 Score Explanation
There is one more CVE-2024-0564 that is similar kind of attack. The attack complexity is for sure high. CVE-2021-3714 has a greater impact on memory deduplication techniques (for example, it can also target Windows 10 OS), while CVE-2024-0564 only targets Linux KSMs, but has a wider target range of applications. The reason for this is that the attacker in CVE-2021-3714 exploits the CoW mechanism, so the attacker needs write access to the deduplicated page. However, it is very difficult for an attacker to perform write access to a specific page of a victim in a remote environment, which requires the assumption that the victim is servicing an in-memory DB application. CVE-2024-0564 does not exploit the CoW mechanism, but rather exploits a feature of KSM's algorithm. Therefore, it is not limited to in-memory DB applications and can be targeted against applications that perform memory mapping and unmapping (e.g., NGINX, which receives user data over the HTTP protocol).
Understanding the Weakness (CWE)
Confidentiality
Technical Impact: Read Application Data
Acknowledgements
Red Hat would like to thank Daniel Gruss (Graz University of Technology), Erik Kraft (Graz University of Technology), Martin Schwarzl (Graz University of Technology), and Moritz Lipp (Graz University of Technology) for reporting this issue.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.