Translated message

A translation of this page exists in English.

Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

RHEL6 の proc_sched_show_task におけるゼロ除算

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6 (x86-64 アーキテクチャー)

Issue

  • RHEL6 カーネルが、proc_sched_show_task 関数内のゼロ除算にてパニックになります。

Resolution

  • RHEL 6: RHSA-2014-1392 で提供される kernel-2.6.32-504.el6 以降のバージョンにアップグレードします。
  • RHEL 6.5 EUS: RHSA-2014:1668 で提供される kernel-2.6.32-431.37.1.el6 以降のバージョンにアップグレードします。

Root Cause

カーネルはある 64 ビット変数がゼロ以外であることを確認すると、それを 32 ビット除数として使用し始めます。これは、下の 32 ビットだけが使用されることを意味します。それが偶然 0 である場合、カーネルがクラッシュします。

Diagnostic Steps

crash> bt
[..]
 #6 [ffff883f96c43d40] divide_error at ffffffff8100bdfb
    [exception RIP: proc_sched_show_task+0x717]
    RIP: ffffffff8105c057  RSP: ffff883f96c43df8  RFLAGS:00010246
    RAX:0000637f795eb61a  RBX: ffff885cf9614080  RCX: ffffffffffffffff
    RDX:0000000000000000  RSI:0000637f795eb61a  RDI:0000000000000000
    RBP: ffff883f96c43e48   R8:00000000fffffffd   R9:0000000000000014
    R10:0000000000000000  R11:0000000000000013  R12: ffff8802568ef640
    R13:431bde82d7b634db  R14:00000000fb2220d9  R15:0000000100000000
 #7 [ffff883f96c43e50] sched_show at ffffffff811ed900
 #8 [ffff883f96c43e70] seq_read at ffffffff811a5352
 #9 [ffff883f96c43ef0] vfs_read at ffffffff81181ac5
#10 [ffff883f96c43f30] sys_read at ffffffff81181c01
[..]
crash> dis -r proc_sched_show_task+0x717 | tail -4
0xffffffff8105c04f <proc_sched_show_task+0x70f>:    mov    %r15d,%edi
0xffffffff8105c052 <proc_sched_show_task+0x712>:    mov    %rsi,%rax
0xffffffff8105c055 <proc_sched_show_task+0x715>:    xor    %edx,%edx
0xffffffff8105c057 <proc_sched_show_task+0x717>:    div    %rdi

r15 は 0000000100000000 になります。

crash> eval 0x100000000 & 0xffffffff
hexadecimal:0  

したがって、最初の 32 個にはビットが設定されません。

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments