Help Center> Elastic Cloud Server> FAQs> OS Management> OS Faults> How Can I Fix the Meltdown and Spectre Security Vulnerabilities on Intel Processor Chips?
Updated on 2023-10-31 GMT+08:00

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 Security Notices.

Prerequisites

Tests have been fully verified and ECS data has been backed up.

Installing a Patch on Linux ECSs

  1. Log in to the ECS.
  2. Check whether Tools has been installed on the Linux 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 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

  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

OS Faults FAQs

more