内容へ移動
tosihisa's public notebook
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
start
»
linux-4.15.1 と retpoline 対応 gcc を組み合わせる.
トレース:
20180205_linux_4_15_1_retp_gcc
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
~~socialite~~ ====== 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 > > because only the assembly code (not the C code) will have the > retpoline mitigation. So keep that in mind. 上記のように,コンパイラ(gcc) で ''retpoline'' をサポートしているかどうかで変わるようですので試してみます. テスト環境は以下のとおりです. <code> $ 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/" </code> ===== linux-4.15.1 と gcc 7.2.1 の組み合わせ ===== gcc 7.2.1 は ''retpoline'' コード生成に対応しています.この gcc でコンパイルした Linux カーネルでは,以下の様になります. <code> $ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2 Mitigation: Full generic retpoline </code> gcc 7.2.1 は,ソースからダウンロードしてビルドしたものを使用しています. <code> $ /opt/gcc_test/bin/gcc --version gcc (GCC) 7.2.1 20180117 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. </code> ===== linux-4.15.1 と gcc 6.3.0 の組み合わせ ===== Debian 9 の gcc は 6.3.0 で,これは''retpoline'' コード生成に対応していません. この gcc でコンパイルした Linux カーネルでは,以下の様になります. <code> $ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2 Vulnerable: Minimal generic ASM retpoline </code> <code> $ gcc --version gcc (Debian 6.3.0-18) 6.3.0 20170516 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. </code>
20180205_linux_4_15_1_retp_gcc.txt
· 最終更新: 2018-02-05 23:30 by
tosihisa@netfort.gr.jp
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ