Bug 905198

Summary: SELinux is preventing /usr/lib64/xulrunner/plugin-container from 'open' accesses on the file /dev/shm/pulse-shm-2263025957.
Product: [Fedora] Fedora Reporter: Stefan Schulze Frielinghaus <fedoraproject>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dmitryburstein, dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:d43791bb6df145e49f8d01af67c40eb3679e493b0dcf464a323a213c35b18cf8
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-08 02:25:34 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:

Description Stefan Schulze Frielinghaus 2013-01-28 20:27:32 UTC
Description of problem:
I encounter this problem when watching e.g. a youtube video via Firefox. I can manually relabel the file but since the files get automatically created this is practically not doable for all files.

Is it possible to create a policy rule such that all new files under the directory are created with the right labels?
SELinux is preventing /usr/lib64/xulrunner/plugin-container from 'open' accesses on the file /dev/shm/pulse-shm-2263025957.

*****  Plugin restorecon (99.5 confidence) suggests  *************************

If you want to fix the label. 
/dev/shm/pulse-shm-2263025957 default label should be user_tmpfs_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /dev/shm/pulse-shm-2263025957

*****  Plugin catchall (1.49 confidence) suggests  ***************************

If you believe that plugin-container should be allowed open access on the pulse-shm-2263025957 file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep plugin-containe /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c
                              0.c1023
Target Context                unconfined_u:object_r:tmpfs_t:s0
Target Objects                /dev/shm/pulse-shm-2263025957 [ file ]
Source                        plugin-containe
Source Path                   /usr/lib64/xulrunner/plugin-container
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           xulrunner-18.0-6.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-73.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.4-204.fc18.x86_64 #1 SMP Wed
                              Jan 23 16:44:29 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-01-28 21:22:51 CET
Last Seen                     2013-01-28 21:22:51 CET
Local ID                      8fca6f4b-6aa9-4f2d-9a50-52b1833fac7f

Raw Audit Messages
type=AVC msg=audit(1359404571.695:918): avc:  denied  { open } for  pid=23982 comm="plugin-containe" path="/dev/shm/pulse-shm-2263025957" dev="tmpfs" ino=299157 scontext=unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:tmpfs_t:s0 tclass=file


type=SYSCALL msg=audit(1359404571.695:918): arch=x86_64 syscall=open success=no exit=EACCES a0=7fff3a03fe30 a1=a0000 a2=0 a3=0 items=0 ppid=23913 pid=23982 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 ses=2 tty=(none) comm=plugin-containe exe=/usr/lib64/xulrunner/plugin-container subj=unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c0.c1023 key=(null)

Hash: plugin-containe,mozilla_plugin_t,tmpfs_t,file,open

audit2allow

#============= mozilla_plugin_t ==============
allow mozilla_plugin_t tmpfs_t:file open;

audit2allow -R

#============= mozilla_plugin_t ==============
allow mozilla_plugin_t tmpfs_t:file open;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.4-204.fc18.x86_64
type:           libreport

Potential duplicate: bug 823039

Comment 1 Daniel Walsh 2013-01-28 20:51:11 UTC
Any idea what process is creating this file?

Comment 2 Stefan Schulze Frielinghaus 2013-01-29 09:11:12 UTC
After experimenting I found out that a wine application creates the file. This means, this is not a mozilla_t problem. Can this be fixed in wine_t or should I create a special policy for my wine app?

Comment 3 Daniel Walsh 2013-01-29 23:53:16 UTC
abd4f726063b2f00072d0e2de92168926c65a952 added to git to allow wine_t to create tmpfs_t files as user_tmpfs_t which will fix this problem.  Thanks for diagnosing this.

Comment 4 Miroslav Grepl 2013-01-30 09:15:04 UTC
Fixed in selinux-policy-3.11.1-74.fc18.noarch

Comment 5 Fedora Update System 2013-01-31 13:19:55 UTC
selinux-policy-3.11.1-74.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-74.fc18

Comment 6 Fedora Update System 2013-02-01 16:41:04 UTC
Package selinux-policy-3.11.1-74.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-74.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-1693/selinux-policy-3.11.1-74.fc18
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-02-08 02:25:36 UTC
selinux-policy-3.11.1-74.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.