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.
Description of problem:
With the virDomainOpenGraphics() API, a client app running unconfined creates a UNIX domain socket (using socketpair()). These socket FDs are label unconfined. It then passes one of these sockets to libvirtd using virDomainOpenGraphics, which passes the socket onto QEMU.
Before passing the socket to QEMU, libvirt must relabel it to svirt_image_t to allow QEMU the ability to use the socket - otherwise it gets silently dropped by sendmsg/recvmsg with an AVC
type=AVC msg=audit(1377167900.795:1188): avc: denied { getattr } for pid=6642 comm="qemu-system-x86" scontext=unconfined_u:system_r:svirt_t:s0:c264,c560 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=unix_stream_socket
The fix to make libvirtd do this relabelling is tracked in bug 999914.
When I fix it to do relabelling though, libvirtd itself now triggers an AVC
type=AVC msg=audit(1377168984.442:1190): avc: denied { relabelto } for pid=3521 comm="lt-libvirtd" name="UNIX" dev="sockfs" ino=879718 scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:svirt_image_t:s0:c264,c560 tclass=unix_stream_socket
IIUC, the problem is the virt.te policy has the following rule
allow virtd_t self:unix_stream_socket { connectto create_stream_socket_perms };
whereas I believe it should be
allow virtd_t self:unix_stream_socket { relabelto connectto create_stream_socket_perms };
Version-Release number of selected component (if applicable):
selinux-policy-3.7.19-211
How reproducible:
Always
More fixes have been added during RHEL6.5 cycle related to libvirt and this bug should be fixed. If no, please re-open the bug and it will be addressed in RHEL6.6.
Description of problem: With the virDomainOpenGraphics() API, a client app running unconfined creates a UNIX domain socket (using socketpair()). These socket FDs are label unconfined. It then passes one of these sockets to libvirtd using virDomainOpenGraphics, which passes the socket onto QEMU. Before passing the socket to QEMU, libvirt must relabel it to svirt_image_t to allow QEMU the ability to use the socket - otherwise it gets silently dropped by sendmsg/recvmsg with an AVC type=AVC msg=audit(1377167900.795:1188): avc: denied { getattr } for pid=6642 comm="qemu-system-x86" scontext=unconfined_u:system_r:svirt_t:s0:c264,c560 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=unix_stream_socket The fix to make libvirtd do this relabelling is tracked in bug 999914. When I fix it to do relabelling though, libvirtd itself now triggers an AVC type=AVC msg=audit(1377168984.442:1190): avc: denied { relabelto } for pid=3521 comm="lt-libvirtd" name="UNIX" dev="sockfs" ino=879718 scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:svirt_image_t:s0:c264,c560 tclass=unix_stream_socket IIUC, the problem is the virt.te policy has the following rule allow virtd_t self:unix_stream_socket { connectto create_stream_socket_perms }; whereas I believe it should be allow virtd_t self:unix_stream_socket { relabelto connectto create_stream_socket_perms }; Version-Release number of selected component (if applicable): selinux-policy-3.7.19-211 How reproducible: Always