Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 668692 - qemu process is spawned with no supplementary groups
qemu process is spawned with no supplementary groups
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.0
Unspecified Unspecified
urgent Severity medium
: rc
: ---
Assigned To: Daniel Veillard
Virtualization Bugs
: TestBlocker, ZStream
Depends On: 664406
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-11 04:46 EST by RHEL Product and Program Management
Modified: 2013-01-10 22:42 EST (History)
18 users (show)

See Also:
Fixed In Version: libvirt-0.8.1-27.el6_0.6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-02 14:22:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0479 normal SHIPPED_LIVE Moderate: libvirt security and bug fix update 2011-05-02 14:22:36 EDT

  None (edit)
Description RHEL Product and Program Management 2011-01-11 04:46:58 EST
This bug has been copied from bug #664406 and has been proposed
to be backported to 6.0 z-stream (EUS).
Comment 5 Laine Stump 2011-01-27 10:48:25 EST
Rebases of the two upstream commits noted below have been posted to rhvirt-patches:


commit d596c6dc9b64ca0c910a87127de72ed2ef47b692
Author: Laine Stump <laine@laine.org>
Date:   Thu Dec 23 01:44:02 2010 -0500

    new virSetUIDGID() utility function
    
commit f42cf7cb7902196382a65e5316c974a5c2106401
Author: Laine Stump <laine@laine.org>
Date:   Tue Dec 21 15:34:41 2010 -0500

    Replace setuid/setgid/initgroups with virSetUIDGID()
Comment 8 wangyimiao 2011-04-26 07:52:03 EDT
Sorry for comment 7,Setps same as bug 64406. 
Issue reproduce on build libvirt-0.8.1-27.el6_0.6.x86_64:

steps:
1, setup a NFS server with exports configuration as follows
/tmp/nfstest  *(rw,root_squash)

2, copy a guest image file into the shared fold. Using chmod+chown to set the
access right ,ownership and groupship of the image file to (otheruser):kvm, the
other user
shouldn't be qemu.

# chown 500:36  http_test.qcow2
# chmod 755 http_test.qcow2

3, In the client machine, mount the NFS shared folder, then, try to boot up a
guest which use the image file as its OS disk.


[reproducer]
# virsh start test
error: Failed to start domain test
error: internal error Process exited while reading console log output: char
device redirected to /dev/pts/8
qemu: could not open disk image /mnt/http_test.qcow2: Permission denied
Comment 9 Jiri Denemark 2011-04-26 10:17:02 EDT
You're doing ``chmod 755 http_test.qcow2'' which means qemu (a member of kvm group) will only be able to read or execute the image while it most likely wants to open that file in rw mode. You should rather do ``chmod 664 http_test.qcow2'' (or 775 if you want the execute permission as well).
Comment 10 Dave Allan 2011-04-27 00:07:17 EDT
Moving back to ON_QA per comment 9.
Comment 11 wangyimiao 2011-04-27 03:50:03 EDT
Setps same as bug 664406 comment 10. 
Verified it build libvirt-0.8.1-27.el6_0.6.x86_64:

steps:
On NFS Server:
1.Make a NFS share path, and use chmod to change it have all permissions.
# mkdir /tmp/nfstest

2.Setup a NFS server with exports configuration as follows.
/tmp/nfstest  *(rw,root_squash)

3.Copy a guest image file into the shared fold. Using chmod+chown to set the
access right ,ownership and groupship of the image file to (otheruser):kvm, the
other user
shouldn't be qemu.

# chown 500:36  rhel61.img
# chmod 664 rhel61.img
# ll -Z rhel61.img 
-rw-rw-r--. ken kvm unconfined_u:object_r:user_tmp_t:s0 rhel61.img


On clinet:

4. In the client machine, mount the NFS shared folder, then, try to boot up a
guest which use the image file as its OS disk.

# mount -o vers=3 10.66.4.210:/tmp/nfstest/ /mnt

5.# virsh start vm2
Domain vm2 started

the ownership wasn't changed by qemu , and it kept kvm group .
# ll -Z /mnt/
-rw-rw-r--. zpeng kvm system_u:object_r:nfs_t:s0       rhel61.img 

So set bug status to VERIFIED
Comment 12 errata-xmlrpc 2011-05-02 14:22:43 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0479.html

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