Help Center > > FAQs> OS Management> OS Faults> How Can I Fix the Meltdown and Spectre Security Vulnerabilities on Intel Processor Chips?

How Can I Fix the Meltdown and Spectre Security Vulnerabilities on Intel Processor Chips?

Updated at: Mar 17, 2020 GMT+08:00

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

  1. Log in to the ECS.
  2. Use either of the following methods to install the patch:

    • Method 1: Use Windows Update to install the patch.
      1. Open Windows Update and click Check for Updates.
      2. 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.

  3. Restart the ECS for the patch to take effect.
  4. Check whether the patch has been installed.

    1. Check whether the ECS is running properly.
    2. Check whether the requirements specified in the Verification column of Background are met.

Installing a Patch on Linux ECSs

  1. Log in to the ECS.
  2. Check whether Tools have been installed on the ECS, taking the SUSE Linux Enterprise Server 11 SP1 as an example.

    1. Run the following command on any directory to view the ECS driver:

      lsmod | grep xen

      Figure 1 Viewing the ECS driver
    2. Run the following command to view the driver path, taking a disk driver as an example:

      modinfo xen_vbd

      Figure 2 Viewing the driver path
    3. Check whether pvdriver is contained in the driver path.
      • If so, Tools have been installed in the ECS. Then, go to 3.
      • If no, go to 4.

  3. Uninstall Tools.

    1. Run the following command to switch to user root:

      su root

    2. Run the following command to uninstall Tools in the root directory:

      /etc/.uvp-monitor/uninstall

    3. Run the following command to restart the ECS:

      reboot

  4. Install the patch to upgrade the kernel. For details, see Background.

    After updating the kernel, run the reboot command to restart the ECS.

  5. Check whether the patch has been installed.

    1. Check whether the ECS is running properly.
    2. Check whether the requirements specified in the Verification column of Background are met.

    After the patch is installed, the driver delivered with the OS is used on the ECS. 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

  1. Click spectre-meltdown-checker to obtain spectre-meltdown-checker.sh.
  2. Upload the script to the ECS.
  3. 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.

    Figure 3 Command output after the script is executed

    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:

    1. 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.
    2. Restart the ECS.
  • 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:

    1. 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.
    2. Restart the ECS.

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

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel