多くのシステムで強化されたユーザーレプリケーションにより、Linux> = 4.8のlshw segfault

多くのシステムで強化されたユーザーレプリケーションにより、Linux> = 4.8のlshw segfault

私達はカスタマイズされた使用しますopsi.orgbootimage は、顧客のクライアントコンピュータに Windows を自動的にインストールします。このブートイメージのユーザー領域は、アップストリームブートイメージに基づいており、一部変更されており、Ubuntuからインポートされたカーネルです。

カーネルをUbuntu yaketyからLinux 4.8.0-42.45にアップグレードした後、顧客からlshwセグメントエラーが原因でインストールが中断されたという苦情が受けられ始めました。

[7] [Apr 27 23:29:08] Expecting compressed data from server (JSONRPC.py|660)
[5] [Apr 27 23:29:08] Running hardware inventory (setup.py|140)
[7] [Apr 27 23:29:08] Command 'lshw' found at: '/usr/bin/lshw' (Posix.py|640)
[6] [Apr 27 23:29:08] Executing: /usr/bin/lshw -xml 2>/dev/null (Posix.py|660)
[6] [Apr 27 23:29:08] Using encoding 'UTF-8' (Posix.py|691)
[7] [Apr 27 23:29:08] Exit code: 139 (Posix.py|748)
[2] [Apr 27 23:29:09] Traceback: (Logger.py|742)
[2] [Apr 27 23:29:09]      line 1390 in '<module>' in file '/usr/local/bin/master.py' (Logger.py|742)
[2] [Apr 27 23:29:09]      line 141 in '<module>' in file '/tmp/setup.py' (Logger.py|742)
[2] [Apr 27 23:29:09]      line 2482 in 'auditHardware' in file '/usr/lib/pymodules/python2.6/OPSI/System/Posix.py' (Logger.py|742)
[2] [Apr 27 23:29:09]      line 2526 in 'hardwareInventory' in file '/usr/lib/pymodules/python2.6/OPSI/System/Posix.py' (Logger.py|742)
[2] [Apr 27 23:29:09]      line 755 in 'execute' in file '/usr/lib/pymodules/python2.6/OPSI/System/Posix.py' (Logger.py|742)
[2] [Apr 27 23:29:09]      ==>>> Command '/usr/bin/lshw -xml 2>/dev/null' failed (139):
 (master.py|1438)

同時に、次のエラーが記録されますdmesg

[   69.852348] usercopy: kernel memory exposure attempt detected from c0080000 (dma-kmalloc-512) (4096 bytes)
[   69.852365] ------------[ cut here ]------------
[   69.852367] kernel BUG at /build/linux-7qXOmc/linux-4.8.0/mm/usercopy.c:75!
[   69.852370] invalid opcode: 0000 [#1] SMP
[   69.852371] Modules linked in: arc4 md4 nls_utf8 cifs fscache joydev rtsx_usb_ms memstick snd_hda_intel rtsx_usb_sdmmc snd_hda_codec snd_hda_core acer_wmi snd_hwdep rtsx_usb r8169 fjes video sparse_keymap snd_pcm mii mei_txe wmi input_leds snd_timer mac_hid snd mei lpc_ich ahci libahci intel_smartconnect soundcore
[   69.852399] CPU: 0 PID: 1528 Comm: lshw Not tainted 4.8.0-42-generic #45-Ubuntu
[   69.852400] Hardware name: Acer Extensa 2508/Extensa 2508, BIOS V1.10 12/15/2014
[   69.852402] task: f6d16f00 task.stack: f6cc6000
[   69.852405] EIP: 0060:[<dd1f7543>] EFLAGS: 00010282 CPU: 0
[   69.852411] EIP is at __check_object_size+0x123/0x12c
[   69.852413] EAX: 0000005e EBX: c0080000 ECX: 00000247 EDX: 00000247
[   69.852414] ESI: 00001000 EDI: dda5944f EBP: f6cc7ee0 ESP: f6cc7eb8
[   69.852416]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[   69.852418] CR0: 80050033 CR2: bf910000 CR3: 36883e40 CR4: 001006f0
[   69.852419] Stack:
[   69.852420]  dda5f86c dda628ce dda97569 c0080000 f1402080 00001000 c0081000 c0080000
[   69.852427]  00090000 00001000 f6cc7f1c dd5074d6 00000000 00001000 bf900678 00010000
[   69.852434]  00080000 00000000 00090000 00000000 00090000 00000000 dd507430 f6cc7f60
[   69.852440] Call Trace:
[   69.852447]  [<dd5074d6>] read_mem+0xa6/0x1f0
[   69.852451]  [<dd507430>] ? write_mem+0x1f0/0x1f0
[   69.852454]  [<dd1fb15f>] __vfs_read+0x1f/0x50
[   69.852457]  [<dd1fb85f>] vfs_read+0x7f/0x140
[   69.852461]  [<dd80a0a0>] ? down_write+0x10/0x40
[   69.852465]  [<dd1fc9e9>] SyS_read+0x49/0xb0
[   69.852469]  [<dd0037cd>] do_fast_syscall_32+0x8d/0x140
[   69.852472]  [<dd80c07a>] sysenter_past_esp+0x47/0x75
[   69.852473] Code: 89 74 24 14 0f 44 ca ba ce 28 a6 dd 89 44 24 10 0f 44 d7 89 5c 24 0c 89 4c 24 08 89 54 24 04 c7 04 24 6c f8 a5 dd e8 15 91 f8 ff <0f> 0b b8 97 28 a6 dd eb b9 55 89 e5 57 56 53 83 ec 1c 3e 8d 74
[   69.852516] EIP: [<dd1f7543>] __check_object_size+0x123/0x12c SS:ESP 0068:f6cc7eb8
[   69.852523] ---[ end trace 5b12719d45b0befe ]---

私の考えでは、Linuxにバグがあるか、lshwハードウェアに問題があるようです。この問題は多くのコンピュータに影響を与えるため、障害のあるハードウェアは除外されました。この問題はLinux> = 4.8でのみ発生するようです。少なくともLinux 4.4は影響を受けません。これは、Linux 4.8で導入されたユーザー複製の強化によって引き起こされる可能性があります。

この問題はすべてのコンピュータには影響しません(たとえば、VirtualBox VMでは正常に動作します。現在テストされている影響を受けるコンピュータはAcer Extensa 2508ノートブックです)。私たちはlshwおそらく非常に古いバージョンを使用しています。

root@testnb:~# uname -a
Linux testnb 4.8.0-42-generic #45-Ubuntu SMP Wed Mar 8 20:05:25 UTC 2017 i686 GNU/Linux
root@testnb:~# lshw -version
B.02.14
root@testnb:~# lshw
Segmentation fault

これが原因かもしれないと疑ってlshwDebian jessieで02.17-1.1を静的にコンパイルしましたが、それも機能しませんでした。

root@testnb:~# uname -a
Linux testnb 4.8.0-42-generic #45-Ubuntu SMP Wed Mar 8 20:05:25 UTC 2017 i686 GNU/Linux
root@testnb:~# ./lshw-02.17-static -version
B.02.17
root@testnb:~# ./lshw-02.17-static 
Segmentation fault

私は最新バージョンのLinux 4.8用のUbuntu yakketyパッケージを試しました。

root@testnb:~# uname -a
Linux testnb 4.8.0-49-generic #52-Ubuntu SMP Thu Apr 20 09:39:42 UTC 2017 i686 GNU/Linux
root@testnb:~# lshw
Segmentation fault
root@testnb:~# ./lshw-02.17-static 
Segmentation fault

UbuntuのLinux 4.10:

root@testnb:~# uname -a
Linux testnb 4.10.0-20-generic #22-Ubuntu SMP Thu Apr 20 09:22:16 UTC 2017 i686 GNU/Linux
root@testnb:~# lshw
Segmentation fault
root@testnb:~# ./lshw-02.17-static 
Segmentation fault

私は今何をすべきかわかりません。どんなアイデアがありますか?

編集:ログで影響を受けるコンピュータのリストを編集しました。

martin@dogmeat ~/pssh/lshw-segfault-bootimage/output % cat *.out | sed 's/.*DMI: //' | sort | uniq
Acer Extensa 2508/Extensa 2508, BIOS V1.09 10/24/2014 (Posix.py|741)
Acer Extensa 2508/Extensa 2508, BIOS V1.10 12/15/2014 (Posix.py|741)
Dell Inc. Latitude D630                   /0KU184, BIOS A17 01/04/2010 (Posix.py|741)
Dell Inc. Latitude E5500                  /0DW634, BIOS A15 11/05/2009 (Posix.py|741)
Dell Inc. Vostro 1015                     /047MWF, BIOS A03 09/01/2010 (Posix.py|741)
FUJITSU ESPRIMO P910/D3162-A1, BIOS V4.6.5.3 R1.19.0 for D3162-A1x 12/17/2012 (Posix.py|741)
FUJITSU ESPRIMO P910/D3162-A1, BIOS V4.6.5.3 R1.22.0 for D3162-A1x 10/15/2013 (Posix.py|741)
Hewlett-Packard HP Compaq 6730b (GW687AV)/30DD, BIOS 68PDD Ver. F.10 07/31/2009 (Posix.py|741)
Hewlett-Packard HP Compaq 8510p /30C5, BIOS 68MVD Ver. F.0F 02/05/2008 (Posix.py|741)
Hewlett-Packard HP EliteBook 2540p/7008, BIOS 68CSU Ver. F.24 09/12/2013 (Posix.py|741)
Hewlett-Packard HP EliteBook 8470p/179B, BIOS 68ICF Ver. F.42 05/20/2013 (Posix.py|741)
Hewlett-Packard HP ProBook 4720s/1411, BIOS 68AZZ Ver. F.0B 09/16/2010 (Posix.py|741)
IBM 1860W25/1860W25, BIOS 70ET40WW (1.04 ) 06/02/2005 (Posix.py|741)
IBM 1860WR7/1860WR7, BIOS 70ET66WW (1.26 ) 05/18/2006 (Posix.py|741)
LENOVO 80ES/Lenovo B50-30, BIOS 9CCN21WW(V1.06) 04/09/2014 (Posix.py|741)
Quanta TW8/SW8/DW8/TW8/SW8/DW8, BIOS A3B92 10/07/2008 (Posix.py|741)
To Be Filled By O.E.M. To Be Filled By O.E.M./ALiveNF6G-GLAN, BIOS P1.70 03/06/2009 (Posix.py|741)
TOSHIBA Satellite Pro R50-B/Satellite Pro R50-B, BIOS Version 1.40   09/25/2014 (Posix.py|741)
TOSHIBA TECRA M10/Portable PC, BIOS Version 3.00 09/08/2009 (Posix.py|741)

EDIT2:lshwDebianstretchの最新バージョンをお試しください。上流:

root@testnb:~# uname -a
Linux testnb 4.8.0-42-generic #45-Ubuntu SMP Wed Mar 8 20:05:25 UTC 2017 i686 GNU/Linux
root@testnb:~# ./lshw-02.18-static 
Segmentation fault
root@testnb:~# ./lshw-static-b1eab6372d 
Segmentation fault

編集3:これで、きれいなLinuxディストリビューション(Ubuntu 17.04 Live CD)を使用してVirtualBox VMでこれをテストし、問題が再現可能であることを確認できます。ただ32ビットlshw

  • まず、64ビットLive CDをお試しくださいlshw。組み込みタスクは次のとおりです。

    root@ubuntu:~# uname -a
    Linux ubuntu 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
    
    root@ubuntu:~# dpkg -l | grep lshw
    ii  lshw                                            02.18-0.1ubuntu3                            amd64        information about hardware configuration
    
    root@ubuntu:~# lshw | wc -l
    231
    
  • 私の静的32ビットビルドの1つにはlshw次のものがありません。

    root@ubuntu:~# ./lshw-02.18-static
    Segmentation fault
    
  • 32ビットLive CDで2回目の試み - 組み込み機能もlshw機能しなくなりました。

    root@ubuntu:~# uname -a
    Linux ubuntu 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:03:14 UTC 2017 i686 i686 i686 GNU/Linux
    
    root@ubuntu:~# dpkg -l | grep lshw
    ii  lshw                                           02.18-0.1ubuntu3                            i386         information about hardware configuration
    
    root@ubuntu:~# lshw
    Segmentation fault
    
  • lshwroot権限なしで実行すると、分割エラーは発生しません。

    ubuntu@ubuntu:~$ lshw | wc -l
    WARNING: you should run this program as super-user.
    WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
    168
    

2台の異なるコンピュータ(1つはASUSTeK H170-PRO / USB 3.1マザーボード、もう1つはASUSTeK P8H77-Mマザーボード)といくつかのVMタイプ(Microsoft Windows - > Windows 7(32ビット)、Microsoft Windows)で実行しました。 -> Windows 10(64ビット)、Linux - > Ubuntu(32ビット)で問題が常に再現されます。

EDIT4:何らかの理由で、今はVirtualBoxのブートイメージの問題を再現できません。たぶんVMの設定によって異なりますか?ただし、Acer Extensa 2508システムではまだ再現できます。この問題は32ビットビルドにのみ影響するように見えるため、64ビットサポートシステムでlshw64ビットブートイメージと静的64ビットビルドを使用して問題を解決しています。lshw

アップストリームのバグレポート:http://www.ezix.org/project/ticket/750

ベストアンサー1

おすすめ記事