
Spectre v4 : Speculative Store Bypass (CVE-2018-3639) Linux向け概念実証
ビルド: gcc spectre-v4.cpp -o spectre
実行: ./spectre
結果:
--------attack--------
low than threshold:155
low than threshold:144
low than threshold:133
low than threshold:0
low than threshold:1
--------attack--------
low than threshold:133
low than threshold:0
low than threshold:1
--------attack--------
low than threshold:0
low than threshold:1
質問:
毎回同じvictim関数を使って別の秘密データを取得しようとすると、失敗してしまいます。
おそらく、2つの命令が依存するロードとストアとしてマークされるため、ロード命令が投機実行されないのだと思います。