ユーザ用ツール

サイト用ツール


20180205_linux_4_15_1_retp_gcc

文書の過去の版を表示しています。


linux-4.15.1 と retpoline 対応 gcc を組み合わせる.

linux-4.15.1 では,spectre v2 の緩和対策が入ったようです.

https://lkml.org/lkml/2018/1/28/173 によると,

You can do

cat /sys/devices/system/cpu/vulnerabilities/spectre_v2

and if you don't have a compiler that supports the retpoline
mitigations, you'll get:

Vulnerable: Minimal generic ASM retpoline

上記のように,コンパイラ(gcc) で retpoline をサポートしているかどうかで変わるようですので試してみます.

テスト環境は以下のとおりです.

$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

linux-4.15.1 と gcc 7.2.1 の組み合わせ

gcc 7.2.1 は retpoline 緩和コード生成に対応しています.この gcc でコンパイルした Linux カーネルでは,以下の様になります.

$ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2
Mitigation: Full generic retpoline
20180205_linux_4_15_1_retp_gcc.1517840397.txt.gz · 最終更新: 2018-02-05 23:19 by tosihisa@netfort.gr.jp