Bug 560887 - (CVE-2010-0309) CVE-2010-0309 kvm: cat /dev/port in guest cause the host hang
CVE-2010-0309 kvm: cat /dev/port in guest cause the host hang
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
reported=20100202,public=20100107,sou...
: Security
Depends On: 553126 560888 560889 560905
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-02 00:25 EST by Eugene Teo (Security Response)
Modified: 2013-04-08 13:19 EDT (History)
15 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-04-08 13:19:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Eugene Teo (Security Response) 2010-02-02 00:25:52 EST
Description of problem:
When execute the command: cat /dev/port in the guest, the host hang immediately (General Protection Fault).

Version-Release number of selected component (if applicable):
kvm-83-140.el5
kmod-kvm-83-140.el5
kvm-qemu-img-83-140.el5
2.6.18-182.el5

How reproducible:
100%

Steps to Reproduce:
1. boot the virtual machine
2. type cat /dev/port in the guest
3.

Actual results:
Host hang

Expected results:
Guest should display the information about virtual devices normally.

Additional info:
1 qemu-kvm command:
/home/devel/autotest/client/tests/kvm/qemu -name vm1 -monitor
tcp:0:6001,server,nowait -drive
file=/home/devel/autotest/client/tests/kvm/images/RHEL-Server-5.4-64.qcow2,if=ide,boot=on
-net nic,vlan=0,model=e1000,macaddr=00:9B:81:0E:91:01 -net
tap,vlan=0,ifname=e1000_0_6001,script=/home/devel/autotest/client/tests/kvm/scripts/qemu-ifup-switch,downscript=no
-m 512 -smp 1 -usbdevice tablet -rtc-td-hack -no-hpet -cpu qemu64,+sse2
-no-kvm-pit-reinjection -vnc :0
2 could be reproduced in kvm-83-142 & 2.6.18.183.el5

Re-tested:

Host \ Guest  |    2.6.18.182  | 2.6.33-rc4  |
--------------+----------------+--------------
2.6.18.185el5 |      FAIL      |   FAIL      |
--------------+----------------+--------------
2.6.33-rc4    |      PASS      |   PASS      |
--------------+----------------+--------------

bt from kernel crash dump:
[root@localhost 2010-01-27-03:10]# gdb
/usr/lib/debug/lib/modules/2.6.18-185.el5debug/vmlinux ./vmcore 
GNU gdb Fedora (6.8-37.el5)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...
[New process 32372]
[New process 0]
#0  0xffffffff8002202b in sys_mprotect (start=18446604440097613992, 
    len=18446604435883844864, prot=18446744071700444726) at mm/mprotect.c:250
250   prot |= PROT_EXEC;
(gdb) bt
#0  0xffffffff8002202b in sys_mprotect (start=18446604440097613992, 
    len=18446604435883844864, prot=18446744071700444726) at mm/mprotect.c:250
#1  0x0000000000001000 in ?? ()

As malicious user could use this method to do the attack, move the priority and
severity to urgent.
Comment 3 Eugene Teo (Security Response) 2010-02-02 00:31:18 EST
The problem is pit_state->channels[] has 3 elements, and pit_ioport_read uses "addr" as index to pit_get_count, so inb(0x43) reads (and potentially writes) into other data of kvm_kpit_state.
Comment 4 Eugene Teo (Security Response) 2010-02-02 00:46:06 EST
http://www.mail-archive.com/kvm@vger.kernel.org/msg28002.html
Comment 6 errata-xmlrpc 2010-02-09 05:02:03 EST
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2010:0088 https://rhn.redhat.com/errata/RHSA-2010-0088.html
Comment 7 errata-xmlrpc 2010-02-09 10:24:11 EST
This issue has been addressed in following products:

  Red Hat Enterprise Virtualization for RHEL-5

Via RHSA-2010:0095 https://rhn.redhat.com/errata/RHSA-2010-0095.html

Note You need to log in before you can comment on or make changes to this bug.