How Can I Fix the Meltdown and Spectre Security Vulnerabilities on Intel Processor Chips?
Symptom
On January 3, 2018 (Beijing time), severe security vulnerabilities Meltdown and Spectre were found on Intel processor chips. The details are as follows:
Vulnerability name: Severe chip-level vulnerabilities on Intel processor chips
Vulnerability IDs: CVE-2017-5753, CVE-2017-5715, and CVE-2017-5754
Severity: High risk
Vulnerability description: High-risk CPU kernel vulnerabilities Meltdown (CVE-2017-5754) and Spectre (CVE-2017-5715 and CVE-2017-5753) exposed. Attackers can use these vulnerabilities to bypass the memory security isolation mechanism and access the core data of the OS and other programs without authorization, leading to sensitive information disclosure.
Impact
These vulnerabilities will not cause attacks between ECSs but may introduce attacks between:
- Applications on an ECS
- Accounts for logging in to an ECS
If your ECSs are created using a public image, the cloud platform will automatically fix the vulnerabilities, which will not affect your services.
If your ECSs are created using a private image, determine whether to install a patch described in this section in the private image based on the impact of the vulnerabilities.
Background
For details about the official patch release of affected OSs, see HUAWEI CLOUD Security Notices.
Prerequisites
Tests have been fully verified and ECS data has been backed up.
Installing a Patch on Windows ECSs
- Log in to the ECS.
- Use either of the following methods to install the patch:
- Method 1: Use Windows Update to install the patch.
- Open Windows Update and click Check for Updates.
- Download and install the required patch.
- Method 2: Manually download and install the patch.
Download the official patch and install it. For details, see Background.
- Method 1: Use Windows Update to install the patch.
- Restart the ECS for the patch to take effect.
- Check whether the patch has been installed.
- Check whether the ECS is running properly.
- Check whether the requirements specified in the Verification column of Background are met.
Installing a Patch on Linux ECSs
- Log in to the ECS.
- Check whether Tools has been installed on the Linux ECS, taking the SUSE Linux Enterprise Server 11 SP1 as an example.
- Run the following command on any directory to view the ECS driver:
Figure 1 Viewing the ECS driver
- Run the following command to view the driver path, taking a disk driver as an example:
Figure 2 Viewing the driver path
- Check whether pvdriver is contained in the driver path.
- Run the following command on any directory to view the ECS driver:
- Uninstall Tools.
- Install the patch to upgrade the kernel. For details, see Background.
After updating the kernel, run the reboot command to restart the ECS.
- Check whether the patch has been installed.
- Check whether the ECS is running properly.
- Check whether the requirements specified in the Verification column of Background are met.
After the patch is installed, the ECS uses the driver delivered with the OS. In this event, the memory usage and disk usage of Linux ECSs will not be monitored. The other features and functions are not affected. If the memory usage and disk usage must be monitored, contact customer service.
Checking Whether Security Vulnerabilities Have Been Fixed on Linux
- Click spectre-meltdown-checker to obtain spectre-meltdown-checker.sh.
- Upload the script to the ECS.
- Run the following commands on the ECS and check whether the Meltdown or Spectre vulnerability has been fixed based on the script prompt:
chmod +x spectre-meltdown-checker.sh
sudo bash spectre-meltdown-checker.sh
Figure 3 shows the command output.
OK indicates that the vulnerability has been fixed, and KO indicates that the vulnerability has not been fixed. The information shown in Figure 3 indicates that the CVE-2017-5753, CVE-2017-5715, and CVE-2017-5754 vulnerabilities have been fixed.
Enabling or Disabling the Security Vulnerability Patch on Linux
CPU speculative execution optimizes performance. Therefore, fixing the Meltdown or Spectre vulnerability may deteriorate performance under specific workloads.
If the impact on the system performance is unacceptable or a better protection solution is available, you can disable certain or all security protection policies.
Determine the optimal security policy based on application scenarios:
- Meltdown vulnerability
Page Table Isolation (PTI) takes effect on the kernel. This function is suitable for CVE-2017-5754.
- Spectre vulnerability
Indirect Branch Restricted Speculation (IBRS) takes effect on specified registers (MSR) in SPEC_CTRL model. Working with retpoline, IBRS controls Indirect Branch Prediction Barriers (IBPBs) on specified registers (MSR) in PRED_CMD model. This function is suitable for CVE-2017-5715.
The CVE-2017-5753 vulnerability is fixed by a kernel patch and cannot be disabled. No obvious impact was detected for the patch in Red Hat performance tests.
- Disabling the Meltdown Vulnerability Patch
To prevent the enabling of PTI from deteriorating the system performance, or a better protection solution is available, perform the following operations to disable the patch:
- Modify kernel parameters based on OSs:
- CentOS, EulerOS, Ubuntu, Fedora, and Red Hat: Add the kernel parameter nopti.
- Debian and OpenSUSE: Add the kernel parameter pti=off.
- Restart the ECS.
- Modify kernel parameters based on OSs:
- Disabling the Spectre Vulnerability Patch
To prevent the Spectre vulnerability fixing from deteriorating the system performance, or a better protection solution is available, perform the following operations to disable the patch:
- Modify kernel parameters based on OSs:
- CentOS, EulerOS, Fedora, Debian, Red Hat, and OpenSUSE: Add the kernel parameter spectre_v2=off.
- Ubuntu: Add the kernel parameter nospectre_v2=off.
- Restart the ECS.
- Modify kernel parameters based on OSs:
If you are using one of the following OSs, visit their official website for more details.
Red Hat: https://access.redhat.com/articles/3311301?spm=a2c4g.11186623.2.20.42b49d4aJuKYx2
SUSE: https://www.suse.com/support/kb/doc/?spm=a2c4g.11186623.2.21.42b49d4avOXw7d&id=7022512
Ubuntu: https://wiki.ubuntu.com/SecurityTeam/KnowledgeBase/SpectreAndMeltdown
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot