[Troubleshooting] ปัญหาเซิร์ฟเวอร์ overload หลังจากอัพเกรดระบบ (Denial of Service through infinite loop)
(เกิดขึ้นนานแล้วแต่ขอ note ไว้หน่อยก็ดี) เหตุการณ์ที่เกิดขึ้นคือเซิร์ฟเวอร์แฮงค์ช่วงเวลาประมาณบ่าย 2 โมง ทุกวัน หลังจากเปิดเครื่องขึ้นมาใหม่ก็จะสามารถใช้งานได้ตามปกติ แต่เมื่อทำการตรวจสอบกลับไม่พบ error message อ้างอิจจาก reference ทำให้สามารถตรวจสอบและเฝ้ามองระบบได้ดั้งนี้
เมื่อใช้คำสั่ง df สำหรับตรวจสอบพื้นที่ใช้งาน กลับพบว่า output ที่ได้ระหว่างคำสั่ง df -h กับ df -i แตกต่างกัน
[sourcecode]linuxserv2:~ # df -h[/sourcecode]
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 30G 7.4G 21G 27% /
udev 3.0G 132K 3.0G 1% /dev
tmpfs 3.0G 4.0M 3.0G 1% /dev/shm
/dev/sda6 99G 13G 81G 14% /data
/dev/sda5 30G 15G 14G 51% /home
/dev/sda7 69G 6.8G 59G 11% /backup
ระบบมีการเขียนไฟล์ในไดร์เรกทอรี tmp อย่างผิดปกติ จากการใช้คำสั่ง df -h ที่พาร์ติชัน filesystem ผลลัพธ์ที่ได้มีพื้นที่ใช้งานได้ 27% แต่เมื่อ df -i (inode) ผลลัพธ์ 88% ซึ่งถ้าเทียบ ณ เวลาประมาณบ่าย 2 โมง
ก็คงทำให้พื้นที่ filesystem มีขนาดเต็ม 100%
[sourcecode]linuxserv2:~ # df -i /tmp/[/sourcecode]
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda2 1966080 1720540 245540 88% /
[sourcecode]stat /tmp[/sourcecode]
ทำการมอนิเตอร์ซับไดร์เรกทอรีภายใน /tmp ดูว่าไดร์เรกทอรีไหนมีการเขียน temp ไฟล์บ้าง
[sourcecode]watch df -i /tmp/orbit-*[/sourcecode]
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda2 1966080 216424 1749656 12% /
/dev/sda2 1966080 216424 1749656 12% /
/dev/sda2 1966080 216424 1749656 12% /
/dev/sda2 1966080 216424 1749656 12% /
/dev/sda2 1966080 216424 1749656 12% /
/dev/sda2 1966080 216424 1749656 12% /
/dev/sda2 1966080 216424 1749656 12% /
/dev/sda2 1966080 216424 1749656 12% /
/dev/sda2 1966080 216424 1749656 12% /
/dev/sda2 1966080 216424 1749656 12% /
มีการเขียน temp ไฟล์ลงไดร์เรกทอรี tmp เพิ่มขึ้นอย่างรวดเร็ว
[sourcecode]watch df -i /tmp/orbit-*[/sourcecode]
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
/dev/sda2 1966080 502634 1463446 26% /
orbit2 – High-Performance CORBA Object Request Broker
ORBit is a high-performance CORBA (Common Object Request Broker Architecture) ORB (Object Request Broker). It allows programs to send requests and receive replies from other programs, regardless of the locations of the two programs. CORBA is an architecture that enables communication between program objects, regardless of the programming language they are written in or the operating system they run on. You will need to install this package if you want to run programs that use the CORBA technology ORBit implementation.
ใช้คำสั่ง stat ตรวจสอบที่ละยูสเซอร์
[sourcecode]stat /tmp/orbit-username1[/sourcecode]
File: `/tmp/orbit-username1′
Size: 1499136 Blocks: 2936 IO Block: 4096 directory
Device: 802h/2050d Inode: 1933344 Links: 2
Access: (0700/drwx——) Uid: ( 1002/username1) Gid: ( 100/ users)
Access: 1970-01-01 07:00:00.000000000 +0700
Modify: 1970-01-01 07:00:00.000000000 +0700
Change: 2013-08-30 15:32:00.000000000 +0700
สรุปปัญหาที่เกิดขึ้นกับเซิร์ฟเวอร์คือ overload due to vnc server can’t start
ข้อผิดพลาดที่พบ:
/vino-server: symbol lookup error: /lib64/libgcrypt.so.11: undefined symbol: gpg_err_set_errno
การแก้ไข:
ให้อัพเกรดแพ็คเกจ libgpg-error0 and libgpg-error0-32bit
Reference:
//www.novell.com/support/kb/doc.php?id=7013143
//manpages.ubuntu.com/manpages/lucid/man1/linc-cleanup-sockets.1.html
//forums.opensuse.org/english/get-technical-help-here/install-boot-login/430200-deleted-everything-tmp-directory-3.html
//www.linuxforums.org/forum/security/167031-question-about-files-tmp-folder.html
//linux.ittoolbox.com/groups/technical-functional/linuxadmin-l/how-to-clean-up-inodes-5018174
//www.cyberciti.biz/faq/linux-bsd-appleosx-unix-find-file-inode/
//www.novell.com/support/kb/doc.php?id=7009075
Bug:
vino has been updated to fix a remote denial of service problem where remote attackers could have caused a infinite loop in vino (CPU consumption). (CVE-2013-5745) Security Issue reference: * CVE-2013-5745
Vulnerability description
=========================
This vulnerability is triggered when the user is required to enter a password.
The server closes the client connection on receiving an unexpected input
sequence from the client.
The unprocessed client data remains in the buffer; the server does not remove
them from buffer since the client connection has been closed.
The result is an infinite loop at the do-while (more_data_pending
(rfb_client->sock)) in vino-server.c:415
The gdm and vino-server processes together take up 100% CPU, causing denial of
service
Leave a Reply