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.
tcontext=system_u:object_r:device_t:s0
^^ your /dev/vhost-vsock is still labeled as device_t
Can you try restoring the new default:
# restorecon /dev/vhost-vsock
# ls -lZ /dev/vhost-vsock
crw-------. root root system_u:object_r:vhost_device_t:s0 /dev/vhost-vsock
It works for me with:
selinux-policy-3.13.1-203.el7.noarch
libvirt-4.4.0-2.el7.x86_64
(In reply to Ján Tomko from comment #2)
> tcontext=system_u:object_r:device_t:s0
> ^^ your /dev/vhost-vsock is still labeled as device_t
>
> Can you try restoring the new default:
> # restorecon /dev/vhost-vsock
> # ls -lZ /dev/vhost-vsock
> crw-------. root root system_u:object_r:vhost_device_t:s0 /dev/vhost-vsock
>
> It works for me with:
> selinux-policy-3.13.1-203.el7.noarch
> libvirt-4.4.0-2.el7.x86_64
It works well after restoring /dev/vhost-vsock.
But /dev/vhost-vsock is labeled as device_t after upgrade selinux-policy to 3.13.1-203. Do I need to reboot the os after upgrading selinux-policy?
My test steps is:
#yum -y update selinux-policy
#rpm -q selinux-policy
selinux-policy-3.13.1-203.el7.noarch
#modprobe vhost_vsock
#ll-Z /dev/vhost-vsock
crw-------. root root system_u:object_r:device_t:s0 /dev/vhost-vsock
Description of problem: SELINUX prevent qemu-kvm process started by libvirt to read/write /dev/vhost-vsock Version-Release number of selected component (if applicable): selinux-policy-3.13.1-203.el7.noarch How reproducible: 100% Steps to Reproduce: 1.Load model in host #modprobe vsock #modprobe vhost_vsock 2.Edit guest xml with vsock device: #virsh edit iommu1 <vsock model='virtio'> <cid auto='no' address='4'/> </vsock> 3.Start the guest: #virsh start iommu1 error: Failed to start domain iommu1 error: internal error: qemu unexpectedly closed the monitor: 2018-06-14T05:19:35.990237Z qemu-kvm: -device vhost-vsock-pci,id=vsock0,guest-cid=4,vhostfd=23,bus=pcie.0,addr=0x7: vhost_set_owner failed: Inappropriate ioctl for device (25) 2018-06-14T05:19:35.990302Z qemu-kvm: -device vhost-vsock-pci,id=vsock0,guest-cid=4,vhostfd=23,bus=pcie.0,addr=0x7: vhost-vsock: vhost_dev_init failed: Operation not permitted 4.Check the audit log: type=VIRT_RESOURCE msg=audit(1528953106.292:14613): pid=23340 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:virtd_t:s0-s0:c0.c1023 msg='virt=kvm resrc=cgroup reason=deny vm="iommu1" uuid=1b3268d6-b59c-406b-a14c-33b000b15b6c cgroup="/sys/fs/cgroup/devices/machine.slice/machine-qemu\x2d3\x2diommu1.scope/" class=all exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success' type=AVC msg=audit(1528953106.310:14625): avc: denied { read write } for pid=415 comm="qemu-kvm" path="/dev/vhost-vsock" dev="devtmpfs" ino=3030467 scontext=system_u:system_r:svirt_t:s0:c455,c920 tcontext=system_u:object_r:device_t:s0 tclass=chr_file Actual results: As step 4 Expected results: No avc denial Additional info: