Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1635228

Summary: libvirt creating qemu channels with the wrong permissions [rhel-7.6.z]
Product: Red Hat Enterprise Linux 7 Reporter: Oneata Mircea Teodor <toneata>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: jiyan <jiyan>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.6CC: dfediuck, dyuan, fjin, hannsj_uhl, jdenemar, jiyan, jsuchane, jtomko, michal.skrivanek, mtessun, mzamazal, pmatyas, rbarry, rcyriac, virt-bugs, virt-maint, xuzhang, yafu
Target Milestone: rcKeywords: Regression, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-4.5.0-10.el7_6.1 Doc Type: Bug Fix
Doc Text:
Cause: Libvirt switched to creating UNIX sockets instead of letting QEMU do it. But forgot to adjust the file permissions. Consequence: Users of the socket expecting qemu's permissions on it cannot access it. Fix: Change the permissions after the socket is created. Result: The socket now has QEMU's user and group.
Story Points: ---
Clone Of: 1633389 Environment:
Last Closed: 2018-10-30 12:21:20 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: 1633389    
Bug Blocks: 1635687    

Description Oneata Mircea Teodor 2018-10-02 12:18:31 UTC
This bug has been copied from bug #1633389 and has been proposed to be backported to 7.6 z-stream (EUS).

Comment 7 jiyan 2018-10-09 06:38:54 UTC
Version:
kernel-3.10.0-957.el7.x86_64
qemu-kvm-rhev-2.12.0-18.el7.x86_64
libvirt-4.5.0-10.virtcov.el7_6.1.x86_64

Steps:
1. Prepare a VM with these two kinds of unix socket devices, start VM and check the dumpxml and qemu cmd line of VM.
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     test1                          shut off

# virsh edit test1
Domain test1 XML configuration edited.

# virsh start test1
Domain test1 started

# virsh dumpxml test1
    <serial type='unix'>
      <source mode='bind' path='/tmp/foo'/>
      <target type='isa-serial' port='1'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial1'/>
    </serial>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-1-test1/com.redhat.rhevm.vdsm'/>
      <target type='virtio' name='com.redhat.rhevm.vdsm' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>

# ps -ef |grep test1 |sed 's/-device/\n-device/g'
-device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charserial1,fd=29,server,nowait
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -chardev socket,id=charchannel1,fd=31,server,nowait

2. According to the dumpxml configuration, check the permission of corresponding files.
# ll -alZ /tmp/foo 
srwxrwxr-x. qemu qemu system_u:object_r:tmp_t:s0       /tmp/foo

# ll -alZ /var/lib/libvirt/qemu/channel/target/domain-1-test1/com.redhat.rhevm.vdsm 
srwxrwxr-x. qemu qemu system_u:object_r:svirt_image_t:s0:c500,c512 /var/lib/libvirt/qemu/channel/target/domain-1-test1/com.redhat.rhevm.vdsm

The results showed in step-2 are as expected, move this bug to be verified.

Comment 9 errata-xmlrpc 2018-10-30 12:21:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3339