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 1340150 - AVC denial when assigning USB sound device to QEMU-KVM guest
Summary: AVC denial when assigning USB sound device to QEMU-KVM guest
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.8
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-26 14:24 UTC by Robert Nichols
Modified: 2017-03-21 09:47 UTC (History)
8 users (show)

Fixed In Version: selinux-policy-3.7.19-298.el6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-21 09:47:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Results from ausearch -m avc -m user_avc -i -ts today (4.25 KB, text/plain)
2016-08-16 16:14 UTC, Robert Nichols
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0627 0 normal SHIPPED_LIVE selinux-policy bug fix update 2017-03-21 12:29:23 UTC

Description Robert Nichols 2016-05-26 14:24:35 UTC
Description of problem:
When a USB sound device is assigned to or removed from a QEMU-KVM guest, an AVC denial occurs when alsactl tries to create a lock file under /var/lock.

Version-Release number of selected component (if applicable):
selinux-policy-3.7.19-292.el6.noarch
selinux-policy-targeted-3.7.19-292.el6.noarch 

How reproducible:
Always.

Steps to Reproduce:
1. In virt-manager, click on "Add Hardware", select "USB Host Device" and an available USB sound device.
2. Click "Finish".

Actual results:
AVC denials either immediately if the guest is running, or when the guest is started.

type=AVC msg=audit(1464239503.474:168): avc:  denied  { write } for pid=6462 comm="alsactl" name="lock" dev="dm-1" ino=1310721 scontext=system_u:system_r:alsa_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_lock_t:s0 tclass=dir permissive=0

type=SYSCALL msg=audit(1464239503.474:168): arch=x86_64 syscall=open success=no exit=EACCES a0=4122a3 a1=c2 a2=1a4 a3=7fff7e7950a0 items=0 ppid=6325 pid=6462 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=alsactl exe=/sbin/alsactl subj=system_u:system_r:alsa_t:s0-s0:c0.c1023 key=(null)


Expected results:
No AVC.

Additional info:
Problem is new following an update from CentOS 6.7 to 6.8.

The device is a 0d8c:013c C-Media Electronics USB PnP Sound Device, but I suspect the particular device does not matter. Similar AVC denials occur when removing the device from the guest or if the guest is shut down while the device is assigned.

Comment 4 Milos Malik 2016-08-16 11:43:34 UTC
Could you repeat the same scenario in permissive mode? Please collect SELinux denials which appear during the time:

# ausearch -m avc -m user_avc -i -ts today

Comment 5 Robert Nichols 2016-08-16 16:14:15 UTC
Created attachment 1191317 [details]
Results from  ausearch -m avc -m user_avc -i -ts today

Results attached. Here is the local policy module that I use to stop the complaints:

module alsalock 1.0;

require {
	type alsa_t;
	type var_lock_t;
	class dir { write add_name };
	class file { create open };
}

#============= alsa_t ==============
#!!!! The source type 'alsa_t' can write to a 'dir' of the following types:
# alsa_var_lib_t, etc_t, alsa_etc_rw_t

allow alsa_t var_lock_t:dir { write add_name };
allow alsa_t var_lock_t:file { create open };

Comment 13 errata-xmlrpc 2017-03-21 09:47:04 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://rhn.redhat.com/errata/RHBA-2017-0627.html


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