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 999922 - Policy denies libvirtd the permission to relabel unix domain sockets
Summary: Policy denies libvirtd the permission to relabel unix domain sockets
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.5
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 999292
TreeView+ depends on / blocked
 
Reported: 2013-08-22 11:25 UTC by Daniel Berrangé
Modified: 2013-10-30 09:46 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 999926 (view as bug list)
Environment:
Last Closed: 2013-10-30 09:46:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Daniel Berrangé 2013-08-22 11:25:59 UTC
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

Comment 2 Miroslav Grepl 2013-08-23 11:46:22 UTC
Could you re-test it with

https://brewweb.devel.redhat.com/buildinfo?buildID=291782

Comment 3 Miroslav Grepl 2013-10-30 09:46:26 UTC
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.


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