LoginSignup
9
9

More than 5 years have passed since last update.

CentOS 6.8(Xen仮想化環境下)でcurlやyumやgitが失敗するようになった

Last updated at Posted at 2016-06-05

Xen仮想化環境下におけるCentOS 6.8で、CPUがハードウェアでAVXサポートまたはAESサポートを持っている場合、nss を使っているHTTPS通信(SSL/TLS)で不具合が出るようで、

$ curl https://www.google.com/
不正な命令です

と出る。うちの場合、

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 45
model name      : Intel(R) Xeon(R) CPU E5-2420 0 @ 1.90GHz
stepping        : 7
microcode       : 1805
cpu MHz         : 1900.085
cache size      : 15360 KB
physical id     : 4
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 4
initial apicid  : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat pln pts dtherm

となっていたので、確かに、AESフラグが点いてる。

最近更新され、CentOS 6.8ではデフォルトでインストールされる nss のパッケージはこんな感じ。

nss-3.21.0-8.el6.x86_64.rpm           2016-05-12 19:50  859K  
nss-sysinit-3.21.0-8.el6.x86_64.rpm   2016-05-12 19:47   47K  
nss-tools-3.21.0-8.el6.x86_64.rpm     2016-05-12 19:46  437K  
nss-util-3.21.0-2.el6.x86_64.rpm      2016-05-12 19:47   67K  

対策

CentOSのバグトラッカー

0010930: curl https://www.google.com -> Illegal Instruction after centos 6.8 update - CentOS Bug Tracker

にありますが、

環境変数を設定し、 export NSS_DISABLE_HW_AES=1 export NSS_DISABLE_HW_GCM=1 で回避できるのですが、環境変数を読まないところで curl を使われていたりするとつらいので、 nss を一時的にダウングレードしておくとよいです。

cd ~/
export NSS_DISABLE_HW_AES=1
export NSS_DISABLE_HW_GCM=1
mkdir RPM-Downgrade; cd RPM-Downgrade
curl -LO http://vault.centos.org/6.7/updates/x86_64/Packages/nss-3.21.0-0.3.el6_7.x86_64.rpm
curl -LO http://vault.centos.org/6.7/updates/x86_64/Packages/nss-sysinit-3.21.0-0.3.el6_7.x86_64.rpm
curl -LO http://vault.centos.org/6.7/updates/x86_64/Packages/nss-tools-3.21.0-0.3.el6_7.x86_64.rpm
curl -LO http://vault.centos.org/6.7/updates/x86_64/Packages/nss-util-3.21.0-0.3.el6_7.x86_64.rpm
yum -y --skip-broken downgrade ./*.rpm
unset NSS_DISABLE_HW_AES
unset NSS_DISABLE_HW_GCM
cd ~/

(2016.6.9追記) WordPressもダッシュボードのwp-admin/themes.phpあたりで子プロセスでHTTPS通信で引っ張ってきているらしく、エラーログに[notice] child pid 17950 exit signal Illegal instruction (4)が乗り死ぬ。空応答なので割と辛い。

(2016.7.24追記)

RedHat ELのほうでは2016/07/12、CentOSのほうでは日本時間で2016/07/13に修正が出ていました。

nss-softokn bug fix update - Red Hat Customer Portal
[CentOS-announce] CEBA-2016:1397 CentOS 6 nss-softokn BugFix Update

上記アップデートにより、特定環境下での nss の動作不良は修正されているため、現時点では、普通に

yum update nss*

にて正常に動作します。

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9