Bug 1066334 (CVE-2013-4148)

Summary: CVE-2013-4148 qemu: virtio-net: buffer overflow on invalid state load
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, amit.shah, aortega, apevec, areis, ayoung, bazulay, berrange, bsarathy, cfergeau, chrisw, cpelland, dblechte, dwmw2, ehabkost, gkotton, gleb, gmollett, idith, iheim, itamar, jkurik, jrusnack, juzhang, knoel, lhh, markmc, minovotn, mkenneth, mrezanin, mst, mtosatti, pbonzini, pfrields, ppandit, rbalakri, rbryant, rhod, rhos-maint, rjones, sclewis, scottt.tw, stefanha, virt-maint, virt-maint, yeylon
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-22 11:23:48 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: 1066430, 1095675, 1095676, 1095677, 1095678, 1102579, 1102580, 1110194, 1110284, 1110288, 1133850    
Bug Blocks: 1036654, 1110626, 1133827    

Description Petr Matousek 2014-02-18 09:19:13 UTC
Michael S. Tsirkin writes:

QEMU 1.0 integer conversion in virtio_net_load()@hw/net/virtio-net.c

>         n->mac_table.in_use = qemu_get_be32(f);

in_use is int so it can get negative when assigned 32bit unsigned value.

>         /* MAC_TABLE_ENTRIES may be different from the saved image */
>         if (n->mac_table.in_use <= MAC_TABLE_ENTRIES) {

passing this check ^^^

>             qemu_get_buffer(f, n->mac_table.macs,
>                             n->mac_table.in_use * ETH_ALEN);

with good in_use value, "n->mac_table.in_use * ETH_ALEN" can get
positive and bigger than mac_table.macs. For example 0x81000000
satisfies this condition when ETH_ALEN is 6.

An user able to alter the savevm data (either on the disk or over the wire
during migration) could use this flaw to to corrupt QEMU process memory on
the (destination) host, which could potentially result in arbitrary code
execution on the host with the privileges of the QEMU process.

Upstream fix:
-------------
  -> http://git.qemu.org/?p=qemu.git;a=commit;h=71f7fe48e10a8437c9d42d859389f37157f59980

Comment 1 Petr Matousek 2014-02-18 10:57:46 UTC
Statement:

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

Comment 4 Prasad Pandit 2014-05-08 11:39:07 UTC
Created qemu tracking bugs for this issue:

Affects: fedora-all [bug 1095676]

Comment 5 Fedora Update System 2014-05-16 10:01:33 UTC
qemu-1.6.2-5.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 errata-xmlrpc 2014-06-09 14:36:34 UTC
This issue has been addressed in following products:

  RHEV-H and Agents for RHEL-6

Via RHSA-2014:0674 https://rhn.redhat.com/errata/RHSA-2014-0674.html

Comment 8 Murray McAllister 2014-06-10 07:39:03 UTC
Acknowledgements:

The issues were discovered as part of the state loading code audit performed by Michael S. Tsirkin of Red Hat, Anthony Liguori and Michael Roth.

Comment 9 errata-xmlrpc 2014-06-10 20:15:30 UTC
This issue has been addressed in following products:

  RHEV-H and Agents for RHEL-6

Via RHSA-2014:0744 https://rhn.redhat.com/errata/RHSA-2014-0744.html

Comment 10 errata-xmlrpc 2014-06-10 20:19:37 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2014:0743 https://rhn.redhat.com/errata/RHSA-2014-0743.html

Comment 14 errata-xmlrpc 2014-07-23 16:15:27 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 7

Via RHSA-2014:0927 https://rhn.redhat.com/errata/RHSA-2014-0927.html

Comment 16 errata-xmlrpc 2014-07-24 15:38:40 UTC
This issue has been addressed in following products:

  OpenStack 4 for RHEL 6
  OpenStack 3 for RHEL 6

Via RHSA-2014:0888 https://rhn.redhat.com/errata/RHSA-2014-0888.html

Comment 18 errata-xmlrpc 2014-09-22 04:00:55 UTC
This issue has been addressed in the following products:

  OpenStack 5 for RHEL 7

Via RHSA-2014:1268 https://rhn.redhat.com/errata/RHSA-2014-1268.html