[Windows][retpoline] Windows10 1809で段階的にロールアウトされるrepolineをすぐに適用する方法

去年は主にIntel CPUにおいて見つかった脆弱性、SpectreとMeltdownで大騒ぎになりましたが、その後脆弱性の緩和策がいくつか公表されています。
その中の一つとしてretpolineというものがありますが、こちらの緩和策についてはLinuxではすでに適用が進んでいましたが、Windowsでもようやく修正パッチとして公開されました。
しかし、今のところ修正パッチを適用してもretpoline自体は有効になっておらず、今後段階的にロールアウトされて有効になるようです。
しかし、どうやら手動で有効にする方法があるようです。
まず前提としてKB4482887の適用が必要です。
そのあと、Windows 10 1809クライアントについては以下のように、コマンドプロンプト(管理者権限で実行)でコマンドを実行すれば良いようです。
1. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverride /t REG_DWORD /d 0x400 2. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverrideMask /t REG_DWORD /d 0x400 3. Reboot
有効になったか確認する手順も参考先に書いてありますのでご確認ください。
自分の環境では有効になっていることを確認出来ました。
PS C:\Windows\system32> Get-SpeculationControlSettings For more information about the output below, please refer to https://support.microsoft.com/en-in/help/4074629 Speculation control settings for CVE-2017-5715 [branch target injection] Hardware support for branch target injection mitigation is present: True Windows OS support for branch target injection mitigation is present: True Windows OS support for branch target injection mitigation is enabled: True Speculation control settings for CVE-2017-5754 [rogue data cache load] Hardware requires kernel VA shadowing: True Windows OS support for kernel VA shadow is present: True Windows OS support for kernel VA shadow is enabled: True Windows OS support for PCID performance optimization is enabled: True [not required for security] Speculation control settings for CVE-2018-3639 [speculative store bypass] Hardware is vulnerable to speculative store bypass: True Hardware support for speculative store bypass disable is present: True Windows OS support for speculative store bypass disable is present: True Windows OS support for speculative store bypass disable is enabled system-wide: False Speculation control settings for CVE-2018-3620 [L1 terminal fault] Hardware is vulnerable to L1 terminal fault: True Windows OS support for L1 terminal fault mitigation is present: True Windows OS support for L1 terminal fault mitigation is enabled: True BTIHardwarePresent : True BTIWindowsSupportPresent : True BTIWindowsSupportEnabled : True BTIDisabledBySystemPolicy : False BTIDisabledByNoHardwareSupport : False BTIKernelRetpolineEnabled : True BTIKernelImportOptimizationEnabled : True KVAShadowRequired : True KVAShadowWindowsSupportPresent : True KVAShadowWindowsSupportEnabled : True KVAShadowPcidEnabled : True SSBDWindowsSupportPresent : True SSBDHardwareVulnerable : True SSBDHardwarePresent : True SSBDWindowsSupportEnabledSystemWide : False L1TFHardwareVulnerable : True L1TFWindowsSupportPresent : True L1TFWindowsSupportEnabled : True L1TFInvalidPteBit : 45 L1DFlushSupported : True
POINT
BTIKernelRetpolineEnabled
とBTIKernelImportOptimizationEnabled
が該当します。