Bug 720773 (CVE-2011-2527)

Summary: CVE-2011-2527 qemu: when started as root, extra groups are not dropped correctly
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: amit.shah, berrange, dwmw2, ehabkost, extras-orphan, itamar, jaswinder, jforbes, knoel, lcapitulino, mkenneth, mtosatti, pmatouse, scottt.tw, shu, tburke, virt-maint, virt-maint
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: qemu did not properly drop extra group privileges when started as root with the -runas commandline option. Consequence: extra GID's would give qemu elevated privileges to read or write files that the supplementary groups allowed, because qemu is still running with group root privileges. Fix: Added an initgroups(3) call to use the -runas user's /etc/groups membership to update the supplementary group IDs. Result: extra group privileges are now properly dropped when using -runas.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-12 18:38:29 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: 720784, 720785, 722582, 722583    
Bug Blocks: 720787    
Attachments:
Description Flags
upstream patch none

Description Vincent Danen 2011-07-12 18:11:34 UTC
It was reported [1] that qemu did not properly drop extra group privileges when started as root with the -runas commandline option.  This means that the extra GID's would give qemu elevated privileges to read or write files that the supplementary groups allowed, because qemu is still running with group root privileges 

When qemu is used by libvirt or vdsm (to launch KVM), however, libvirt itself drops privileges prior to launching qemu, so when started in this fashion there is no elevation of privileges to the qemu process.

[1] https://bugs.launchpad.net/qemu/+bug/807893

Comment 1 Vincent Danen 2011-07-12 18:26:19 UTC
A proposed patch is available here:

https://bugs.launchpad.net/qemu/+bug/807893/comments/1

This also only affects qemu versions greater than 0.10.0 (where the -runas option was introduced).

Comment 2 Vincent Danen 2011-07-12 18:27:53 UTC
Created qemu tracking bugs for this issue

Affects: fedora-all [bug 720784]
Affects: epel-5 [bug 720785]

Comment 3 Vincent Danen 2011-07-14 18:16:02 UTC
Created attachment 513239 [details]
upstream patch

Commit cc4662f9642995c78bed587707eeb9ad8500035b from upstream to fix the flaw.

Comment 5 Petr Matousek 2011-07-15 18:54:35 UTC
Statement:

Future qemu-kvm updates in Red Hat Enterprise Linux 6 may address this flaw. This issue did not affect the versions of qemu-kvm as shipped with Red Hat Enterprise Linux 5 as it did not include support for "run as" functionality.

Comment 7 Eduardo Habkost 2011-11-17 16:32:55 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: qemu did not properly drop extra group privileges when started as root with the -runas commandline option.

Consequence: extra GID's would give qemu elevated privileges to read or write files that the supplementary groups allowed, because qemu is still running with group root privileges.

Fix:  Added an initgroups(3) call to use the -runas user's /etc/groups membership to update the supplementary group IDs.

Result: extra group privileges are now properly dropped when using -runas.

Comment 8 errata-xmlrpc 2011-12-06 15:53:17 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2011:1531 https://rhn.redhat.com/errata/RHSA-2011-1531.html

Comment 9 Fedora Update System 2012-06-07 23:06:52 UTC
qemu-0.14.0-9.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.