Patching Your Thinkpad T460/T470 Against Meltdown, Spectre, ROCA, and IME Vulnerabilities

A Guide For Linux Users

Michael Stypa
plapadoo
5 min readApr 15, 2018

--

The Intel Management Engine’s BIOS default password is “admin”.

Patches for Meltdown and Spectre seem to be readily available from most vendors at this point. Additionally the whole chaos around Intel’s Management Engine (IME) bugs has calmed down. This should be a good time to patch everything up. The fixes seem to be stable enough to roll out and we did just that at plapadoo. Here, we present our findings to help others get a quick overview what has to be done.

Note: We have only tested with Thinkpads of the T460 and T470 series, but this article should also be applicable to other models of Lenovo’s T-series.

Note: Even though this article aims at linux users, you will still need windows to install some security patches.

Intel Management Engine Firmware Update

The situation

Intel’s Security Advisory describes a privilege escalation in their Management Engine that is implemented in a wide range of products (INTEL-SA-00075). The escalation can be performed locally or remotely.

There is a separate advisory page (INTEL-SA-00086) dedicated to followup patches fixing additional security holes in the IME.

While you can use Linux to check if your IME firmware is vulnerable to
SA-00075, or SA-00086, you will need Windows to update the firmware and actually fix the vulnerabilities.

Checking if you are vulnerable

You can use Intel’s detection tools for SA-00075 and SA-00086 to check if your system is vulnerable to these security issues. To do so, you will need python2 (only for SA-00086 detection tool) and root access. Also, your kernel has to have CONFIG_INTEL_MEI and CONFIG_INTEL_MEI_ME enabled. If this is the case, you should have a device called /dev/mei0.

You can run the SA-00075 detection tool like this:

cd /tmp && git clone https://github.com/intel/INTEL-SA-00075-Linux-Detection-And-Mitigation-Tools SA-00075 && cd SA-00075 && make && sudo ./INTEL-SA-00075-Discovery-Tool

It will print something like the following in case you are vulnerable:

 — — — — — — — — — Vulnerability Status — — — — — — — — — — 
Based on the version of the Intel(R) MEI, the System is Vulnerable.
If Vulnerable, contact your OEM for support and remediation of this system.
For more information, refer to CVE-2017–5689 at:
https://nvd.nist.gov/vuln/detail/CVE-2017-5689 or the Intel security advisory
Intel-SA-00075 at:
https://security-center.intel.com/advisory.aspx?intelid=INTEL-SA-00075&languageid=en-fr
— — — — — — — — — — — — — — — — — — — — — — — — — — — — —

The following will be printed if your system is already patched:

— — — — — — — — — Vulnerability Status — — — — — — — — — — 
System is not Vulnerable, no further action needed.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — —

To run the SA-00086 detection tool, you can use the following command:

cd /tmp && curl -fsSL https://downloadmirror.intel.com/27150/eng/SA00086_Linux.tar.gz | tar -xz && sudo python2 intel_sa00086.py

It will print something like the following in case you are vulnerable:

*** Risk Assessment ***
Based on the analysis performed by this tool: This system is vulnerable.
Explanation:
The detected version of the Intel(R) Management Engine firmware
is considered vulnerable for INTEL-SA-00086.
Contact your system manufacturer for support and remediation of this system.

The following will be printed if your system is already patched:

*** Risk Assessment ***
Based on the analysis performed by this tool: This system is not vulnerable. It has already been patched.

Patching the IME firmware

Unfortunately, you will need Windows to install the IME firmware update which fixes the vulnerabilities. Go to Lenovo’s support page, search for your specific Thinkpad model, and download the latest version of the IME firmware and install it. Wait for all the reboots to happen. Later, run the detection tools under Linux again as described above and check if your system is now patched.

Setting a password for IME BIOS Access

You should also change the password of your IME’s own BIOS by hitting <CTRL>+<P> during boot. The default password is “admin”. Make sure to change it to a strong password. Using simple passwords will be rejected with a generic message saying “Error applying new password”. Steve Gibson talks about this in his Podcast “Security Now” and gives some details about why it is a good idea to set a strong IME BIOS password:

Part about IME starts at minute 13

Infineon TPM Chip Firmware Update

As you already have Windows up and running, you may also want to update your TPM chip’s firmware. Go to Lenovo’s support page, search for your specific Thinkpad model, and download for the “TPM Firmware Update Utility”. Run it and let it update your firmware.

Important: The firmware update will erase data stored on the TPM chip. So if you are already using the TPM chip, you have to make sure that you don’t lose any important keys. Losing a key would mean the loss of all data encrypted with that key.

Updating the TPM firmware fixes the so-called “ROCA” vulnerability where Infineon TPM chips generate weak RSA keys in some cases. This also affected older Yubikeys. Watch Steve Gibson explaining ROCA in “Security Now”:

Jump to minute 15 for the part about ROCA

Meltdown and Spectre

There are different measures to mitigate Meltdown, Spectre v1, and Spectre v2. Basically, a combination of the following gives good protection against these attacks:

  • Using a kernel >= 4.16.0
  • Compiling your software (especially the kernel) with gcc 7.3 or higher
  • Updating your CPU’s microcode

Checking which measures are already in place

Since kernel 4.15, you can check which mitigations are already active by running:

grep . /sys/devices/system/cpu/vulnerabilities/*

For a fully protected system, the output should look like this:

/sys/devices/system/cpu/vulnerabilities/meltdown:Mitigation: PTI
/sys/devices/system/cpu/vulnerabilities/spectre_v1:Mitigation: __user pointer sanitization
/sys/devices/system/cpu/vulnerabilities/spectre_v2:Mitigation: Full generic retpoline, IBPB, IBRS_FW

If your kernel is compiled with gcc < 7.3, you will get Minimal generic ASM retpoline instead of Full generic retpoline.

If your CPU’s microcode is not up to date, you will be missing IBPB, IBRS_FW. If this is the case, update your UEFI Firmware to make sure an up to date microcode is loaded into the CPU at boot time. You can find the latest UEFI Firmware by going to Lenovo’s support page and searching for your specific Thinkpad model.

Alternatively, there are ways to load microcode patches with Linux in grub, inserted into the kernel, or manually from user space. For more information about microcode loading have at look at these gentoo wiki pages:

You can also check dmesg to find information about the running microcode version:

dmesg | grep microcode

You should get some lines like this:

[    0.493690] microcode: sig=0x506e3, pf=0x20, revision=0x84
[ 0.493838] microcode: Microcode Update Driver: v2.2.

And after you updated the microcode the revision number increased:

[    0.504084] microcode: sig=0x506e3, pf=0x20, revision=0xc2
[ 0.504247] microcode: Microcode Update Driver: v2.2.

--

--