Debianのwoody (3.0), sarge (3.1), etch (4.0), lenny (5.0)でbashの脆弱性問題に対応する手法


bashの脆弱性問題で、Debianで既にアップデートされないバージョンであるところの、woody (3.0), sarge (3.1), etch (4.0), lenny (5.0)に対して、簡単に対応する手法があるのか?というのを調べてみた。

Seewebというクラウドとホスティングをやっている会社にお勤めのDebianメンテナのMarco d’Itriさんが、会社の後援を受けて古いバージョン用の非公式debianパッケージを公開してくれています。
CVE-2014-6271 fix for Debian woody, sarge, etch and lenny

配布場所については、上記からたどってください。
(http://ftp.linux.it/pub/People/md/bash/ なんですが、Seeweb社の後援を受けて公開されていますので、敬意を表してここから配布場所への直リンクはしないでおきます)

どのバージョンのbashをダウンロードすればいいのかは、現在インストールされているパッケージのバージョンを調べてください。

olddebian:~# dpkg -l|grep bash
ii  bash                                                     3.2-4                    The GNU Bourne Again SHell
ii  bash-completion                                          20080705                   programmable completion for the bash shell
olddebian:~#

上記であれば、「bash」の「3.2-4」です。
配布場所のファイル一覧から「bash_3.2-4.???_amd64.deb」や「bash_3.2-4.???_i386.deb」のうち、数字が一番新しいものを探します。

2014/09/30 20:00現在だと「bash_3.2-4.2_amd64.deb」が最新でした。
これをwgetコマンドなどでダウンロードし、dpkg -iでインストールします。

手順としては、まずは、https://github.com/hannob/bashcheck/からbash脆弱性確認スクリプトを入手します。

olddebian:~# wget --no-check-certificate https://github.com/hannob/bashcheck/raw/master/bashcheck
<略>
olddebian:~# chmod a+x bashcheck
olddebian:~# ./bashcheck
Vulnerable to CVE-2014-6271 (original shellshock)
Vulnerable to CVE-2014-7169 (taviso bug)
./bashcheck: line 18: 20675 Segmentation fault      bash -c "true $(printf '<<EOF %.0s' {1..79})" 2> /dev/null
Vulnerable to CVE-2014-7186 (redir_stack bug)
Test for CVE-2014-7187 not reliable without address sanitizer
Variable function parser still active, likely vulnerable to yet unknown parser bugs like CVE-2014-6277 (lcamtuf bug)
olddebian:~#

脆弱性があることを確認したら、配布元のページから、debパッケージをダウンロードします。

「wget http://ftp.linux.it/pub/People/md/bash/bash_~.deb」という感じでダウンロードします。

ダウンロード後は、debパッケージを「dpkg -i」でインストールします。

olddebian:~# dpkg -i bash_3.2-4.2_i386.deb
(Reading database ... 19825 files and directories currently installed.)
Preparing to replace bash 3.2-4 (using bash_3.2-4.2_i386.deb) ...
Unpacking replacement bash ...
Setting up bash (3.2-4.2) ...
Processing triggers for man-db ...
olddebian:~#

インストール後、パッケージバージョンの確認と、脆弱性確認を行います。

olddebian:~# dpkg -l|grep bash
ii  bash                                                     3.2-4.2                    The GNU Bourne Again SHell
ii  bash-completion                                          20080705                   programmable completion for the bash shell
olddebian:~# ./bashcheck
Not vulnerable to CVE-2014-6271 (original shellshock)
Not vulnerable to CVE-2014-7169 (taviso bug)
Not vulnerable to CVE-2014-7186 (redir_stack bug)
Test for CVE-2014-7187 not reliable without address sanitizer
Variable function parser inactive, likely safe from unknown parser bugs
olddebian:~#

これで、現段階では、問題がなくなりました。


おまけ

squeeze(6.0)の場合、squeeze-ltsに切り替えることで対応できます。
「/etc/apt/sources.list」に以下を追加します。

deb http://http.debian.net/debian squeeze-lts main contrib non-free
deb-src http://http.debian.net/debian squeeze-lts main contrib non-free

そして、bashだけをアップデートしたいのであれば、以下を実行します。

root@olddebian:~# apt-get update
<略>
root@olddebian:~# apt-get install -t squeeze-lts --only-upgrade bash
<略>
root@olddebian:~# 

ネタ元:「How to only install security updates on debian」「bash vulnerability CVE-2014-6271 (Shellshock) fix on debian squeeze [duplicate]

vSphere Flash Read Cache(vFRC)でSSDが見付からない


vSphere Flash Read Cache(vFRC)を使ってみようとセットアップしようとした。
しかし、「SSD」として認識されているものの「仮想フラッシュリソース管理」で該当デバイスが出てこない。

どういうことか調査した。

1. esxcfg-scsidevsコマンドでの認識状況

下記の様になっている。

~ # esxcfg-scsidevs -l
naa.600508b1001c3c4aacc8c33d825d7ff4
   Device Type: Direct-Access
   Size: 114439 MB
   Display Name: HP Serial Attached SCSI Disk (naa.600508b1001c3c4aacc8c33d825d7ff4)
   Multipath Plugin: NMP
   Console Device: /vmfs/devices/disks/naa.600508b1001c3c4aacc8c33d825d7ff4
   Devfs Path: /vmfs/devices/disks/naa.600508b1001c3c4aacc8c33d825d7ff4
   Vendor: HP        Model: LOGICAL VOLUME    Revis: 5.42
   SCSI Level: 5  Is Pseudo: false Status: degraded
   Is RDM Capable: true  Is Removable: false
   Is Local: false Is SSD: true
   Other Names:
      vml.0200030000600508b1001c3c4aacc8c33d825d7ff44c4f47494341
   VAAI Status: unknown
<略>
~ #

ここでの注目ポイントは
「Is Local:」と「Is SSD:」の値。

「Is Local: false Is SSD: true」とは、「Localではなくが、SSDである」と認識されていることになる。

2. esxcli storage vflash device listでの認識状況

vFRCの旧名である「vflash」という名前を持つコマンドを使って、SSDデバイスの認識状況を確認する。

~ # esxcli storage vflash device list
Name                                    Size  Is Local  Is Used in vflash  Eligibility
------------------------------------  ------  --------  -----------------  ----------------------------
naa.600508b1001c3c4aacc8c33d825d7ff4  114439     false              false  Detected as a remote SAS SSD
~ #

「Detected as a remote SAS SSD」と認識されていることが何かのキーになっている、ということもうかがえる。

では、どのようにすれば使える様になるのか?

「Detected as a remote SAS SSD」というメッセージを手がかりに探したところ、VMwareのcommunityに「” Detected as a remote SAS SSD” vFlash」というのを発見。

the solution. thanks for the pointer vfrank.org

esxcli storage nmp satp rule add –satp VMW_SATP_LOCAL –device naa.XXXXXX 0 –option enable_local

esxcli storage core claiming reclaim -d naa.XXXXXXX

該当デバイスの「Is local」認識を強制的に変更する、というもの。
上記コマンド例では「–device naa.XXXXXX 0 –option enable_local」とあるが「0」がなぜ入っているのかよく分からない。
エラーになったので、実行したのは「esxcli storage nmp satp rule add –satp VMW_SATP_LOCAL –device naa.XXXXXX –option enable_local」と「esxcli storage core claiming reclaim -d naa.XXXXXXX」となる。

~ # esxcli storage nmp satp rule add --satp VMW_SATP_LOCAL --device naa.600508b1001c3c4aacc8c33d825d7ff4 --option enable_local
~ #  esxcli storage vflash device list
Name                                    Size  Is Local  Is Used in vflash  Eligibility
------------------------------------  ------  --------  -----------------  ----------------------------
naa.600508b1001c3c4aacc8c33d825d7ff4  114439     false              false  Detected as a remote SAS SSD
~ # esxcli storage core claiming reclaim -d naa.600508b1001c3c4aacc8c33d825d7ff4
~ # esxcli storage vflash device list
Name                                    Size  Is Local  Is Used in vflash  Eligibility                            
------------------------------------  ------  --------  -----------------  -------------------------------------------
naa.600508b1001c3c4aacc8c33d825d7ff4  114439      true              false  Yes, there are valid partitions for vflash
~ #

これにより「Is Local true」となった。

esxcfg-scsidevsでも、「Is Local: true Is SSD: true」となった。

~ # esxcfg-scsidevs -l
naa.600508b1001c3c4aacc8c33d825d7ff4
   Device Type: Direct-Access
   Size: 114439 MB
   Display Name: HP Serial Attached SCSI Disk (naa.600508b1001c3c4aacc8c33d825d7ff4)
   Multipath Plugin: NMP
   Console Device: /vmfs/devices/disks/naa.600508b1001c3c4aacc8c33d825d7ff4
   Devfs Path: /vmfs/devices/disks/naa.600508b1001c3c4aacc8c33d825d7ff4
   Vendor: HP        Model: LOGICAL VOLUME    Revis: 5.42
   SCSI Level: 5  Is Pseudo: false Status: on
   Is RDM Capable: false Is Removable: false
   Is Local: true  Is SSD: true
   Other Names:
      vml.0200030000600508b1001c3c4aacc8c33d825d7ff44c4f47494341
   VAAI Status: unknown
<略>
~ #

この状態となったら、GUIからvFRCの設定が行えるようになった。

該当SSDに対してvFRCの設定を行ったあとの「esxcli storage vflash device list」の結果は以下の様になった。

~ # esxcli storage vflash device list
Name                                    Size  Is Local  Is Used in vflash  Eligibility
------------------------------------  ------  --------  -----------------  ---------------------------------
naa.600508b1001c3c4aacc8c33d825d7ff4  114439      true               true  It has been configured for vflash
~ #

RHEL6/CentOS6をOracle Linuxにしてみる


2020/09/28追記

Oracle公式のCentOSからの移行手順「Switch your CentOS systems to Oracle Linux」とRHELからサポートありのOracleLinuxへの移行手順「Switching from Red Hat Network (RHN) to Oracle Unbreakable Linux Network (ULN)

また、逆にRedHat公式によるCentOS/Oracle LinuxからRHELへの移行手順「How to convert from CentOS or Oracle Linux to RHEL

また、レポジトリによっては下記の様なメッセージが出るようになったようです。

IMPORTANT: A legacy Oracle Linux yum server repo file was found. Oracle Linux yum server repository configurations have changed which means public-yum-ol7.repo will no longer be updated. New repository configuration files have been installed but are disabled. To complete the transition, run this script as the root user:

/usr/bin/ol_yum_configure.sh

See https://yum.oracle.com/faq.html for more information.


Oracle Linux用にOpenStackがリリースされた、ということなので、Oracle Linuxの環境を用意してみようと思った。
つい先ほど、RHEL4/CentOS4でOralce Linuxにしてみたので、同じようにできるかな、と思ったらちょっと工夫が必要でした。
(注:手法としては、既知のディストリビューション乗り換え手法なんですけどね)

1. GPG Keyの入手

[root@centos6 ~]# wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
--2014-09-26 16:40:22--  http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
public-yum.oracle.com をDNSに問いあわせています... 203.179.83.11, 203.179.83.19
public-yum.oracle.com|203.179.83.11|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 1011 [text/plain]
`/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle' に保存中

100%[===================================================&amp;gt;] 1,011       --.-K/s 時間 0s

2014-09-26 16:40:22 (4.83 MB/s) - `/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle' へ保存完了 [1011/1011]

[root@centos6 ~]# 

2. yumレポジトリの編集
Oracle Linux用レポジトリの追加と、CentOS用レポジトリの削除

[root@centos6 ~]# cd /etc/yum.repos.d
[root@centos6 yum.repos.d]# wget http://public-yum.oracle.com/public-yum-ol6.repo
--2014-09-26 16:40:45--  http://public-yum.oracle.com/public-yum-ol6.repo
public-yum.oracle.com をDNSに問いあわせています... 203.179.83.11, 203.179.83.19
public-yum.oracle.com|203.179.83.11|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 4233 (4.1K) [text/plain]
`public-yum-ol6.repo' に保存中

100%[===================================================&amp;gt;] 4,233       --.-K/s 時間 0s

2014-09-26 16:40:46 (323 MB/s) - `public-yum-ol6.repo' へ保存完了 [4233/4233]

[root@centos6 yum.repos.d]# ls
CentOS-Base.repo       CentOS-Media.repo  public-yum-ol6.repo
CentOS-Debuginfo.repo  CentOS-Vault.repo
[root@centos6 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.disable
[root@centos6 yum.repos.d]# mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.disable
[root@centos6 yum.repos.d]# mv CentOS-Media.repo CentOS-Media.repo.disable
[root@centos6 yum.repos.d]# mv CentOS-Vault.repo CentOS-Vault.repo.disable
[root@centos6 yum.repos.d]#

で、アップデート実施

[root@centos6 yum.repos.d]# yum update -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Update Process
Resolving Dependencies
--&amp;gt; Running transaction check
---&amp;gt; Package audit.x86_64 0:2.2-2.el6 will be updated
<略>
Transaction Check Error:
  file /etc/issue from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64
  file /etc/issue.net from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64
  file /etc/redhat-release from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64
  file /etc/rpm/macros.dist from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64
  file /etc/system-release from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64
  file /etc/system-release-cpe from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64

Error Summary
-------------

[root@centos6 yum.repos.d]#

oraclelinux-releaseパッケージと、centos-releaseパッケージが競合するというもの。

/var/cache/yum/x86_64/6/ol6_latest/packages/に、oraclelinux-releaseパッケージがダウンロードされているので、rpmコマンドを使って強制的にインストールする。

[root@centos6 yum.repos.d]# rpm -Uvh --force /var/cache/yum/x86_64/6/ol6_latest/packages/oraclelinux-release-6Server-5.0.2.x86_64.rpm /var/cache/yum/x86_64/6/ol6_latest/packages/redhat-release-server-6Server-6.5.0.1.0.1.el6.x86_64.rpm
準備中...                ########################################### [100%]
   1:redhat-release-server  ########################################### [ 50%]
   2:oraclelinux-release    ########################################### [100%]
[root@centos6 yum.repos.d]#

これで「yum update」が可能になりました。

再起動後は以下の様な状態となりました。

[root@centos6 ~]# uname -a
Linux centos6.adosakana.net 2.6.32-431.29.2.el6.x86_64 #1 SMP Tue Sep 9 11:28:47 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@centos6 ~]# rpm -qa|grep release
redhat-release-server-6Server-6.5.0.1.0.1.el6.x86_64
centos-release-6-4.el6.centos.10.x86_64
oraclelinux-release-6Server-5.0.2.x86_64
[root@centos6 ~]# cat /etc/motd
[root@centos6 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@centos6 ~]#

ちなみに、Oracle Linux 6では、以下の追加レポジトリがある。
・MySQL 5.5 (ol6_MySQL)
・MySQL 5.6 (ol6_MySQL56)
・Unbrakable Enterprise kernel 2.6.39 (ol6_UEK_latest)
・Unbrakable Enterprise kernel 3.8.13 (ol6_UEKR3_latest)
・常に最新kernel。 (ol6_playground_latest)

詳細については、以前書いた「Oracle Linux用の公開レポジトリについて」を参照のこと。

Intel&Spreadtrum&RDA



中国のSoCメーカ、SpreadtrumのPress newsを見ていたら「Intel and Tsinghua Unigroup Collaborate to Accelerate Development and Adoption of Intel-based Mobile Devices」というのを発見。

Spreadtrum(展讯通信有限公司)って、Tsinghua Unigroup(紫光集团有限公司)というところの一員だったんだ、と内容を読んでいくとびっくり。
まず、Tsinghua Unigroupというのは、Tsinghua University(清华大学)を含む企業グループなんですが、7月にRDA Microelectronicsというチップメーカを買収(Tsinghua Unigroup Closes US$907 Million Acquisition of RDA Microelectronics for US$18.50 Per ADS)し、一員に加え居ていたという。

で・・・SpreadtrumはCPU系と、CPUと無線を統合したもの(SoC)が得意、RDAは無線系が得意、そして、どちらも、3GおよびLTEをやっている。

ということで、Intelが中国のタブレット、スマートフォン事業に本格的に進出するために提携を組んだようです。

2015年後半から、実際のSoC製品が出てくるようなんですが・・・果たして、どんなものが出てくるのやら

RHEL4/CentOS4をOracle Linux4に!


今回の件を検証するため、CentOS4をセットアップした。

が・・・yum updateとかすると、エラー。
原因はCentOS4のレポジトリがアーカイブ化されてしまい、ミラーされなくなったため。

[root@centos4 ~]# yum update
Setting up Update Process
Setting up repositories
not using ftp, http[s], or file for repos, skipping - 4 is not a valid release or hasnt been released yet
Cannot find a valid baseurl for repo: update
Error: Cannot find a valid baseurl for repo: update
[root@centos4 ~]#

/etc/yum.repos.d/CentOS-Base.repo内にある「http://mirror.centos.org/centos/$releasever/」を「http://vault.centos.org/4.9/」、「http://mirror.centos.org/centos/RPM-GPG-KEY-centos4」を「http://vault.centos.org/RPM-GPG-KEY-centos4」に書き換え、また、「mirrorlist=~」をコメントにし、逆に「#baseurl=~」のコメントを外すことでアップデートはできるようになる。

が・・・、面倒なので、Oracle LinuxのPublic Yum Serverを使用するように切り替えてみる。
つまりは、Oracle Linuxへの乗り換え、ということになる。

切り替え手順は簡単。
How can I convert an RHEL or RHEL-compatible system to Oracle Linux using public-yum?」と「Getting Started」を行う。

具体的には、「OracleのGPGキーを登録」してから、「Yumレポジトリを追加」、ということになる。

[root@centos4 ~]# wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el4 -O /usr/share/rhn/RPM-GPG-KEY-oracle
--01:57:00--  http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el4
           => `/usr/share/rhn/RPM-GPG-KEY-oracle'
public-yum.oracle.com をDNSに問いあわせています... 203.179.83.11, 203.179.83.19
public-yum.oracle.com|203.179.83.11|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 1,744 (1.7K) 

100%[====================================>] 1,744         --.--K/s

01:57:01 (87.54 MB/s) - `/usr/share/rhn/RPM-GPG-KEY-oracle' を保存しました [1744/1744]

[root@centos4 ~]# gpg --quiet --with-fingerprint /usr/share/rhn/RPM-GPG-KEY-oracle
gpg: failed to create temporary file `/root/.gnupg/.#lk0x552ac57280.centos4.adosakana.net.4053': そのようなファイルやディレクトリはありません
gpg: 新しい構成ファイル`/root/.gnupg/gpg.conf'ができました
gpg: 警告: 「/root/.gnupg/gpg.conf」のオプションは起動している間、有効になりません
pub  1024D/B38A8516 2006-09-05 Oracle OSS group (Open Source Software group) <build@oss.oracle.com>
                指紋 = 1122 A29A B257 825F 322C  234E 2E2B CDBC B38A 8516
sub  2048g/0042D4F4 2006-09-05 [有効期限: 2011-09-04]
[root@centos4 ~]# cd /etc/yum.repos.d
[root@centos4 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.disabled
[root@centos4 yum.repos.d]# wget http://public-yum.oracle.com/public-yum-el4.repo
--01:58:33--  http://public-yum.oracle.com/public-yum-el4.repo
           => `public-yum-el4.repo'
public-yum.oracle.com をDNSに問いあわせています... 203.179.83.19, 203.179.83.11
public-yum.oracle.com|203.179.83.19|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 1,191 (1.2K) 

100%[====================================>] 1,191         --.--K/s

01:58:33 (70.99 MB/s) - `public-yum-el4.repo' を保存しました [1191/1191]

[root@centos4 yum.repos.d]#

この後、「yum update」を実行すれば完了です。

ちなみに、この手法でアップデートした場合、release関連情報は以下のようになります。

[root@centos4 ~]# rpm -qa|grep release
enterprise-release-4-3.7.18
[root@centos4 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 9)
[root@centos4 ~]#  rpm -qa|grep logo
oracle-logos-1.1.1-3
[root@centos4 ~]#

また、/etc/yum.repos.d/ULN-Base.repo が追加されますが、こいつが問題児で、2014年9月現在、これは使用できません。
無効にしてしまいましょう。

[root@centos4 ~]# mv /etc/yum.repos.d/ULN-Base.repo /etc/yum.repos.d/ULN-Base.repo.disabled
[root@centos4 ~]#

ついでに、vmware-toolsをyumレポジトリとして追加するには、/etc/yum.repos.d/vmwaretools.repoとして、以下の内容を記載しましょう。

[root@centos4 ~]# cat /etc/yum.repos.d/vmwaretools.repo
[vmwaretools]
name=vmwaretools
baseurl=http://packages.vmware.com/tools/esx/latest/rhel4/x86_64/
gpgcheck=0
[root@centos4 ~]#

X-Windowsがあるシステムの場合「yum install vmware-tools-esx」、X-Windowsがないシステムなら「yum install vmware-tools-esx-nox」でvmware-toolsをインストールできます。