Windows 10: Enable Retpoline to mitigate Spectre variant 2 (CVE-2017-5715)

Discus and support Enable Retpoline to mitigate Spectre variant 2 (CVE-2017-5715) in AntiVirus, Firewalls and System Security to solve the problem; Following the release of Cumulative Update KB4482887 Windows 10 v1809 Build 17763.348 there is a lot of discussion regarding the new Retpoline... Discussion in 'AntiVirus, Firewalls and System Security' started by ddelo, Mar 11, 2019.

  1. ddelo Win User

    Enable Retpoline to mitigate Spectre variant 2 (CVE-2017-5715)


    Following the release of Cumulative Update KB4482887 Windows 10 v1809 Build 17763.348 there is a lot of discussion regarding the new Retpoline mitigation.
    This feature has been included in the KB4482887, but is disabled by default. In future updates, or the next Feature Update (only Microsoft knows when), the feature will be enabled by default on Windows 10 clients.

    So to shed some light in the issue, first we need to understand what Meltdown and Spectre, with all its variants are.

    The best source of information can be found in this Microsoft article “Windows client guidance for IT Pros to protect against speculative execution side-channel vulnerabilities”

    So to make a long story short, these are the most recently identified vulnerabilities, until the time this post is created:

    Public Name CVE Vulnerability Exploit Name Bounds Check Bypass CVE-2017-5753 Spectre Variant 1 Branch Target Injection CVE-2017-5715 Spectre Variant 2 Kernel Virtual Address shadow /
    Rogue Data Cache Load CVE-2017-5754 Meltdown Variant 3 Rogue System Register Read CVE-2018-3640 Spectre-NG Variant 3a Speculative Store Bypass CVE-2018-3639 Spectre-NG Variant 4 L1 Terminal Fault CVE-2018-3615,
    CVE-2018-3620,
    CVE-2018-3646 Foreshadow & Foreshadow-NG Lazy FP State Restore CVE-2018-3665 Spectre-NG Bounds Check Bypass Store CVE-2018-3693 Spectre-NG Variant 1.1 Read-only protection bypass Spectre Variant 1.2
    Get the required information
    Mitigate the vulnerabilities
    To mitigate the vulnerabilities you must follow these simple steps:
    • Check your PC’s manufacturer Support page, for an updated BIOS/UEFI. If there is one, download it and update your PC.
    • If the manufacturer doesn’t provide an updated BIOS/UEFI for your PC (usually done for older PCs. It’s the manufacturer’s way of telling to buy a new one!), then look for the latest Microsoft Microcode Update for your Windows 10 version. Download it from the Windows Update catalog and apply it.
    How the microcode works:
    • At boot time, BIOS/UEFI loads the microcode from the firmware. This microcode comes preinstalled with your PC and is updated ONLY by a BIOS/UEFI update provide by the system manufacturer, based on code provided to him by the CPU vendor (intel/AMD etc)
    • When the OS takes over, it checks the microcode loaded by the firmware to see if it’s up to date. If it is proceeds and leaves thins as they are loaded by the BIOS/UEFI. If it’s not up to date, the supersedes the BIOS/UEFI loaded microcode by the latest one that Windows 10 have via a recent update from Microsoft. That is now becoming the “Currently Running microcode”, which can be newer than the one the CPU firmware has.
    • In any case this microcode is flushed upon system shutdown.
    Retpoline
    This is software code, developed by Google, to mitigate Spectre variant 2 (CVE-2017-5715), while providing some performance improvement by doing so, as in general the updated microcode revisions against the Spectre/Meltdown vulnerabilities tend to degrade performance.
    To enable Retpoline please follow the steps in the Windows Kernel Internals blog post: Mitigating Spectre variant 2 with Retpoline on Windows

    After enabling Retpoline, you will see an improvement in the performance, but don't expect anything major and certainly not performance degradation.

    A couple of interesting points:
    The two Registry entries, to be added or changed, as described in the above Windows Kernel Internals blog post, might exist or might not exist in your Registry.
    • They might exist, if at the early stages of the Spectre/Meltdown mitigation process, you had applied a Windows update, because your BIOS/UEFI microcode was out-of-date and the manufacturer didn’t provide one.
    • On the other hand, if you don’t have them, doesn’t mean that you’re not protected. It’s because either you applied a BIOS/UEFI update from your PC’s manufacturer, or you applied one of the recent (1803/1809) Microsoft updates, which don’t create the Registry entries.
    To apply the Retpoline mitigation you have to add the FeatureSettingsOverride and FeatureSettingsOverrideMask entries in your Registry (if you don’t have them) or change the two entries in the Registry (if you already have them).

    • If you don’t have them just open PowerShell as Administrator and run the following two commands:
      Code: New-ItemProperty -Path 'Registry::\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' -Name FeatureSettingsOverride -PropertyType DWord -Value 1024 New-ItemProperty -Path 'Registry::\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' -Name FeatureSettingsOverrideMask -PropertyType DWord -Value 1024[/quote] OR copy and paste the following in a text file. Save it, with an extension .reg and merge it in your Registry, by double-clicking it.
      Code: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management] "FeatureSettingsOverride"=dword:00000400 "FeatureSettingsOverrideMask"=dword:00000400[/quote]
    • If you already have them, as the Windows Kernel Internals blog post says, you need to “bitwise OR” them, in other words add the hex value 400 to the one you already have.
      To do that find the Registry entries under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management key.
      Double click on each one of them, and after making sure that you have chosen “Hexadecimal” as Base, add the hex value 400 to the one you have. For example if the value you already had was 8 type 408, if it was 3, type 403. Click OK, clode the Registry Editor and reboot.
      That’s it.


      Enable Retpoline to mitigate Spectre variant 2 (CVE-2017-5715) [​IMG]

    Not for everybody
    The last thing you should have in mind is that not all CPUs are capable of the Retpoline mitigation.
    According to intel, the processors based on the Intel microarchitecture codename Skylake and subsequent models will not be able to use Retpoline. In this case adding/changing the above two Registry entries will just enable the BTIKernelImportOptimizationEnabled feature and leave the BTIKernelRetpolineEnabled as false.

    That’s it, so far.
    Hope to have helped you. *Smile
    Dimitri

    :)
     
    ddelo, Mar 11, 2019
    #1
  2. Brink Win User

    Mitigating Spectre variant 2 with Retpoline on Windows


    Source: Mitigating Spectre variant 2 with Retpoline on Windows - Microsoft Tech Community - 295618
     
    Brink, Mar 11, 2019
    #2
  3. EdTittel Win User
    Mitigating Spectre variant 2 with Retpoline on Windows


    After this result from Get-SpeculationControlSetting, looks like my Skylake production PC is (mostly) safe:

    Enable Retpoline to mitigate Spectre variant 2 (CVE-2017-5715) [​IMG]

    --Ed--

    See this MS Support Document to make sense of the output from Get-SpeculationControlSettings for your own PCs.
     
    EdTittel, Mar 11, 2019
    #3
  4. Brink Win User

    Enable Retpoline to mitigate Spectre variant 2 (CVE-2017-5715)

    KB4078407 Update to enable mitigation against Spectre, Variant 2


    Source: https://support.microsoft.com/en-us/...ctre-variant-2


    Direct download link for KB4078407 EXE file from Microsoft Update Catalog:

    *Arrow Download KB4078407 MSU for Windows 10,Windows 10 LTSB,Windows Server 2016 - 24 KB
     
    Brink, Mar 11, 2019
    #4
Thema:

Enable Retpoline to mitigate Spectre variant 2 (CVE-2017-5715)

Loading...
  1. Enable Retpoline to mitigate Spectre variant 2 (CVE-2017-5715) - Similar Threads - Enable Retpoline mitigate

  2. Microsoft CVE-2017-5715: Guidance to mitigate speculative execution side-channel...

    in AntiVirus, Firewalls and System Security
    Microsoft CVE-2017-5715: Guidance to mitigate speculative execution side-channel...: Microsoft CVE-2017-5715: Guidance to mitigate speculative execution side-channel vulnerabilitiesMicrosoft CVE-2017-5753: Guidance to mitigate speculative execution side-channel vulnerabilitiesMicrosoft CVE-2017-5754: Guidance to mitigate speculative execution side-channel...
  3. Retpoline

    in Windows 10 BSOD Crashes and Debugging
    Retpoline: Hi community, I have 2 question: 1,Is there anyway to know exactly if my pc has Retpoline ? 2, Is there anyway to disable Spectre Variant 2 which cause performance issues ? I read about it on Windowslatest.com Appreciate all your help <3 Thank you...
  4. To implement Retpoline function in c/c++ high level function for mitigating Spectre variant...

    in AntiVirus, Firewalls and System Security
    To implement Retpoline function in c/c++ high level function for mitigating Spectre variant...: I have a query on spectre insecurity threats to modern CPUs on Windows OS. CVE-2017-5715, also known as spectre variant 2. Branch target injection spectre variant 2 can be mitigated using retpoline. I am unable to implement retpoline in c/c++ function. Can some one help? I...
  5. Mitigating Spectre variant 2 with Retpoline on Windows

    in Windows 10 News
    Mitigating Spectre variant 2 with Retpoline on Windows: In January 2018, Microsoft released an advisory and security updates related to a newly discovered class of hardware vulnerabilities involving speculative execution side channels (known as Spectre and Meltdown) that affect AMD, ARM, and Intel CPUs to varying degrees. If you...
  6. Can Spectre, Meltdown etc mitigations be bypassed?

    in Windows 10 Support
    Can Spectre, Meltdown etc mitigations be bypassed?: I noticed Chrome have updated their browser with a 'new security feature' that will keep users safe from Spectre etc, however it will use 10-13% more RAM because of the increased number of processes running in real time. With this in mind - I know Microsoft has said that...
  7. KB4078130 Update to Disable Mitigation against Spectre, Variant 2

    in Windows 10 News
    KB4078130 Update to Disable Mitigation against Spectre, Variant 2: Critical Update to Disable Mitigation against Spectre, Variant 2 Applies to: Windows 7 Service Pack 1, Windows 8.1, Windows 10, Windows 10 Version 1511, Windows 10 Version 1607, Windows 10 Version 1703, Windows 10 version 1709, Windows Server 2008 R2 Standard, Windows...
  8. Spectre mitigations in MSVC

    in Windows 10 News
    Spectre mitigations in MSVC: Microsoft is aware of a new publicly disclosed class of vulnerabilities, called “speculative execution side-channel attacks,” that affect many operating systems and modern processors, including processors from Intel, AMD, and ARM. On the MSVC team, we’ve reviewed information...
  9. Intel Microcode Revision Guidance for Spectre variant 2 - April 2

    in Windows 10 News
    Intel Microcode Revision Guidance for Spectre variant 2 - April 2: The following table provides details of availability for microcode updates currently planned by Intel. Changes since the previous version are highlighted in yellow. LEGEND: Production Status: • Planning – Intel has not yet determined a schedule for this MCU. •...
  10. KB4078407 Update to enable mitigation against Spectre, Variant 2

    in Windows 10 News
    KB4078407 Update to enable mitigation against Spectre, Variant 2: This update does not provide protection against Spectre Variant 2. All it does is turn on protection if you had previously disabled it because of a bad BIOS update.

Users found this page by searching for:

  1. /guard:retpoline

    ,
  2. disable retpoline registry