After the Spectre mitigations caused relative slowdowns on some CPU microarchitectures and on certain workloads, Microsoft Windows engineers have announced that they will be implementing Google’s Retpoline mitigation for Spectre variant 2 (CVE- 2017-5715).
Spectre V2 Patches
Google was already testing Retpoline on its own servers for months before the Spectre bug was made public because the company’s Project Zero team was among the researchers that found out that Spectre existed. However, Google made Retpoline public only a day after the Spectre bug leaked. By then, Microsoft and Intel, which also learned about the Spectre bug months earlier, had already developed their own patch that mitigated against Spectre V2. However, you had to receive the microcode update from your motherboard or laptop OEM.
Another problem is Microsoft’s patch has a significantly larger impact on performance compared to Google’s Retpoline. As such, the Windows developers have begun working on an implementation of the Retpoline mitigation for Windows 10.
The patch will not arrive to Windows 10 users until the next major Windows 10 update in the first half of 2019. Furthermore, Microsoft will not backport the Retpoline patch to previous versions of Windows, including older builds of Windows 10.
What Does the Retpoline Patch Do?
Spectre v2 is a “branch target injection” vulnerability which leverages the speculative execution behavior of the CPU to cause some code to leak information that can then be used in an attack against a host machine.
According to Google, Retpoline “sequences” are a software construct that allows indirect branches to be isolated from speculative execution. This solution could be applied to protect sensitive binaries of an operating system or a hypervisor implementation from branch target injections against their indirect branches.
The name of Retpoline is a combination of the words “return” and “trampoline.” Why trampoline, you ask? That’s because when using return operations, any associated speculative execution will 'bounce' endlessly.
In previous posts, Google said that the performance impact of Retpoline is negligible. Windows kernel developer Mehmet Iyigun also said on Twitter that the new patch will reduce the performance impact of Spectre v2 mitigations to “noise-level" for most scenarios.
In case it wasn’t already clear, the Retpoline patch doesn’t affect any of the other speculative execution vulnerabilities that have been disclosed this year.