Updated on 2/05/2018
Google Project Zero team discovered a method to read privileged memory from user space by utilizing CPU data cache timing to leak information out of mis-speculated execution. Variants of this issue are known to affect many modern processors, including certain processors by Intel, AMD and ARM. For more details refer to this blogpost.
So far, there are three known variants of the issue:
- Variant 1: bounds check bypass (CVE-2017-5753)
- Variant 2: branch target injection (CVE-2017-5715)
- Variant 3: rogue data cache load (CVE-2017-5754)
Variants 1 & 2 are referred to as Spectre and Variant 3 as Meltdown.
Timesys has been monitoring vendor websites and open source mailing lists regarding affected CPUs and software mitigation strategies, and below are our findings:
Summary of affected CPUs:
Note: For more details on the exact versions of CPUs affected, visit the vendor website in the link provided above.
Upstream software mitigation status:
x86: Patches are in the works
Arm: Patches not yet available
Mitigated in latest WebKit, Firefox, Chrome
x86: Waiting for upstream patches to make it to LTS releases
Currently integrating latest Webkit into Factory
Update CPU microcode and apply kernel patches
x86 MITIGATION 2
Applying a software mitigation (e.g., Google’s Retpoline) to the hypervisor, operating system kernel, system programs and libraries, and user applications
Arm: Apply kernel patches
Intel: microcode update available
AMD: microcode update for latest processors available
x86 MITIGATION 2
Kernel: Patches are available in mainline and are being backported to LTS versions
GCC: GCC 7.3 or later has retpoline support
Arm: Patches available on Arm git tree and under review on arm-kernel mailing list (version 4)
Intel: Waiting on stable Intel microcode
x86 MITIGATION 2
Kernel: Waiting on fixes to make it to LTS releases
GCC: In the pipeline for integration
Arm: Waiting on upstream patches to get accepted. Basic testing has been done on i.MX6Q processors.
Arm: Patches available on Arm git tree and under review on arm-kernel mailing list
Arm: N/A. Cortex A75 based boards not available in Timesys Factory.
Note: Yocto customers please contact Timesys for providing fixes.
Considerations before applying patches
Can your product be exploited?
Based on our experience, interacting with customers’ typical embedded systems running Linux are mostly closed systems that do not allow running arbitrary code. So unless your product allows running 3rd party or WEB applications, we believe the device is not exposed to exploits based on the above vulnerabilities. So it might be worthwhile to assess the security impact for your product before rushing to fix it.
Microcode update (x86 only):
Microcode updates are typically handled via BIOS updated via hardware vendor. However, it is possible for a Linux based system to load the microcode at runtime (done on every boot). For applying the latest microcode on Linux, follow the instructions in the Release Notes provided by Intel in their microcode package. Please read the microcode update guidance document from Intel since there are potential system stability issues with the latest microcode.
There have been reports of performance impacts when applying the patches and/or microcode. The impact depends on the operations being performed by the CPU, and we recommended profiling the system under full load after updating the system to understand the performance impact for your use case.
Variant 3 alone requires more than 40+ patches to be applied to the kernel. Given the severity of the vulnerability, the kernel maintainers are backporting the patches to LTS (Long term stable) versions of the kernel.
Is my kernel patched?
On x86 based systems, there are 2 methods to check if the version of kernel running on target has been patched for the spectre and meltdown vulnerabilities.
Method 1: Run the below script after going through README. The script will report if your CPU is vulnerable and if any mitigations are in place. https://github.com/speed47/spectre-meltdown-checker
Method 2: On LTS kernel versions, read the below files on the target file system
# ls /sys/devices/system/cpu/vulnerabilities/ meltdown spectre_v1 spectre_v2 # cat /sys/devices/system/cpu/vulnerabilities/meltdown Mitigation: PTI # cat /sys/devices/system/cpu/vulnerabilities/spectre_v1 Vulnerable # cat /sys/devices/system/cpu/vulnerabilities/spectre_v2 Vulnerable: Minimal generic ASM retpoline
Non x86 based systems are yet to add any hooks for reporting the status.
Patch flux and ongoing monitoring:
Given the nature of attack, the fixes are going to be ongoing as nuances of the attack are understood. Many of the currently submitted patches are still under review and will take weeks before making it into LTS kernel release.
Timesys will continue to monitor the status on the above CVEs and update this blog post as fixes become available. For information about your board, contact Timesys.
Timesys has extensive experience with embedded system development and lifecycle management. Timesys has been instrumental in working with global leader semiconductor manufacturers with smart, quick and quality solutions for highly complex systems with accelerated product innovation and multiple product variants.