Bug 1229640 (CVE-2015-3214)

Summary: CVE-2015-3214 qemu/kvm: i8254: out-of-bounds memory access in pit_ioport_read function
Product: [Other] Security Response Reporter: Petr Matousek <pmatouse>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abaron, aortega, apevec, areis, ayoung, carnil, chrisw, dallan, gkotton, gmollett, jen, knoel, lhh, lpeer, markmc, mrezanin, mst, pbonzini, rbalakri, rbryant, sclewis, security-response-team, yeylon
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
An out-of-bounds memory access flaw, leading to memory corruption or possibly an information leak, was found in QEMU's pit_ioport_read() function. A privileged guest user in a QEMU guest, which had QEMU PIT emulation enabled, could potentially, in rare cases, use this flaw to execute arbitrary code on the host with the privileges of the hosting QEMU process.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-28 22:51:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1229646, 1229647, 1243696, 1243698, 1243699, 1243726, 1243727, 1243728, 1243729    
Bug Blocks: 1227344, 1227412    
Attachments:
Description Flags
Upstream patch none

Description Petr Matousek 2015-06-09 10:23:31 UTC
Due converting PIO to the new memory read/write api we no longer provide
separate I/O region lenghts for read and write operations. As a result,
reading from PIT Mode/Command register will end with accessing
pit->channels with invalid index and potentially cause memory corruption and/or
minor information leak.

A privileged guest user in a guest with QEMU PIT emulation enabled could
potentially (tough unlikely) use this flaw to execute arbitrary code on the
host with the privileges of the hosting QEMU process. (QEMU part of the vulnerability)

A privileged guest user in a guest could potentially (tough unlikely) use this flaw to execute arbitrary code on the host. (KVM part of the vulnerability)

Acknowledgements:

Red Hat would like to thank Matt Tait of Google's Project Zero security team
for reporting this issue.

Comment 2 Petr Matousek 2015-06-09 10:32:28 UTC
Created attachment 1036692 [details]
Upstream patch

Comment 3 Petr Matousek 2015-06-09 10:35:19 UTC
Statement: 

This issue does not affect the versions of the qemu and qemu-kvm packages as shipped with Red Hat Enterprise Linux 5, 6 and Red Hat Enterprise Linux 6 based versions of qemu-kvm-rhev packages as shipped with Red Hat Enterprise Virtualization 3. 

This issue does affect the Red Hat Enterprise Linux 7 qemu-kvm and Red Hat Enterprise Linux 7 based versions of the qemu-kvm-rhev packages as shipped with Red Hat Enterprise Virtualization 3. Future updates for the respective releases may address this flaw.

Please note that by default QEMU/KVM guests use in-kernel (KVM) PIT emulation
in which case the following applies:

This issue does not affect the Linux kernel versions as shipped with Red Hat Enterprise Linux 5, 6, 7 and Red Hat Enterprise Linux MRG 2.

This issue does affect the kvm package as shipped with Red Hat Enterprise Linux 5. 

Red Hat Enterprise Linux 5 is now in Production 3 Phase of the support and maintenance life cycle. This has been rated as having Moderate security impact and is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/.

Comment 6 Petr Matousek 2015-06-17 11:02:30 UTC
Upstream patch submission:

https://www.mail-archive.com/qemu-devel@nongnu.org/msg304063.html

Comment 10 Petr Matousek 2015-07-16 07:31:11 UTC
Created qemu tracking bugs for this issue:

Affects: fedora-all [bug 1243728]

Comment 11 Petr Matousek 2015-07-16 07:31:45 UTC
Created qemu tracking bugs for this issue:

Affects: epel-7 [bug 1243729]

Comment 13 errata-xmlrpc 2015-07-27 12:59:43 UTC
This issue has been addressed in the following products:

  RHEV-H and Agents for RHEL-7

Via RHSA-2015:1508 https://rhn.redhat.com/errata/RHSA-2015-1508.html

Comment 14 errata-xmlrpc 2015-07-27 13:32:12 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2015:1507 https://rhn.redhat.com/errata/RHSA-2015-1507.html

Comment 15 errata-xmlrpc 2015-07-28 18:12:37 UTC
This issue has been addressed in the following products:

  OpenStack 5 for RHEL 7
  OpenStack 6 for RHEL 7

Via RHSA-2015:1512 https://rhn.redhat.com/errata/RHSA-2015-1512.html

Comment 16 Fedora Update System 2015-08-18 05:16:42 UTC
qemu-2.3.1-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2015-08-23 16:41:00 UTC
qemu-2.4.0-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2015-09-01 07:26:23 UTC
qemu-2.1.3-9.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.