Bug 858328

Summary: SELinux is preventing /usr/bin/remote-viewer from 'create' accesses on the file installer1.png.
Product: [Fedora] Fedora Reporter: Jason Brooks <jbrooks>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:26c51f7b1c8103735d153776bdf550109803dd884cb48faaed0f3b4bc26903d5
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-27 10:44:36 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:
Attachments:
Description Flags
File: type
none
File: hashmarkername none

Description Jason Brooks 2012-09-18 16:43:54 UTC
Additional info:
libreport version: 2.0.13
kernel:         3.4.6-2.fc17.x86_64

description:
:SELinux is preventing /usr/bin/remote-viewer from 'create' accesses on the file installer1.png.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that remote-viewer should be allowed create access on the installer1.png 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 remote-viewer /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:user_home_t:s0
:Target Objects                installer1.png [ file ]
:Source                        remote-viewer
:Source Path                   /usr/bin/remote-viewer
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           virt-viewer-0.5.3-1.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-146.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.4.6-2.fc17.x86_64 #1 SMP Thu Jul
:                              19 22:54:16 UTC 2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    2012-09-18 09:42:35 PDT
:Last Seen                     2012-09-18 09:42:35 PDT
:Local ID                      5ba7dc7b-0409-49bf-a542-74e0777b63cc
:
:Raw Audit Messages
:type=AVC msg=audit(1347986555.750:9048): avc:  denied  { create } for  pid=27563 comm="remote-viewer" name="installer1.png" scontext=unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1347986555.750:9048): arch=x86_64 syscall=open success=no exit=EACCES a0=51dc810 a1=241 a2=1b6 a3=238 items=0 ppid=27559 pid=27563 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=2 comm=remote-viewer exe=/usr/bin/remote-viewer subj=unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c0.c1023 key=(null)
:
:Hash: remote-viewer,mozilla_plugin_t,user_home_t,file,create
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Jason Brooks 2012-09-18 16:43:56 UTC
Created attachment 614056 [details]
File: type

Comment 2 Jason Brooks 2012-09-18 16:43:58 UTC
Created attachment 614057 [details]
File: hashmarkername

Comment 3 Daniel Walsh 2012-09-20 01:26:40 UTC
Do you know where it is trying to create

installer1.png

What does remote-viewer do?

To get this to work you might want to turn off your plugin lockdown with SELinux

setsebool -P 
unconfined_mozilla_plugin_transition 1

Comment 4 Daniel Walsh 2012-09-20 01:28:28 UTC
Opps that should have been


setsebool -P 
unconfined_mozilla_plugin_transition 0

Comment 5 Jason Brooks 2012-09-20 15:25:39 UTC
(In reply to comment #3)
> Do you know where it is trying to create
> 
> installer1.png
> 
> What does remote-viewer do?

I'm using remote-viewer to access a VM desktop (hosted on a separate machine under ovirt) via spice. remote-viewer has a "take screenshot" option, and that's what I'm using. I'm forgetting now exactly where I was saving the file, probably in my ~/Pictures, definitely somewhere in my home dir.

> 
> To get this to work you might want to turn off your plugin lockdown with
> SELinux
> 
> setsebool -P 
> unconfined_mozilla_plugin_transition 1

Thanks

Comment 6 Miroslav Grepl 2012-09-20 17:23:16 UTC
Dan, 
it looks like we get lot of apps which run as mozilla_plugin_t and these apps will need to run without mozilla_plugin confinement. 

We could just add them to on the list which is a part of a new setroubleshoot plugin?

Comment 7 Jason Brooks 2012-09-20 17:32:15 UTC
(In reply to comment #6)
> Dan, 
> it looks like we get lot of apps which run as mozilla_plugin_t and these
> apps will need to run without mozilla_plugin confinement. 
> 
> We could just add them to on the list which is a part of a new
> setroubleshoot plugin?

With oVirt, remote-viewer is launched from a firefox plugin, spice-xpi.

Comment 8 Daniel Walsh 2012-09-26 21:03:27 UTC
That is fine, but what directory is spice trying to write to?

locate installer1.png

If we could label the directory this content gets created in, somewhere other then ~/ then we could allow the access and continue to run with confinement.

Comment 9 Jason Brooks 2012-09-26 21:59:06 UTC
(In reply to comment #8)
> That is fine, but what directory is spice trying to write to?
> 
> locate installer1.png

It didn't write anywhere, it wasn't allowed.

When you go to File --> Screenshot in remote viewer, the app puts you in the default gnome file dialog, in recently used folders. By default, it invites you to choose some arbitrary place in your home dir.

> 
> If we could label the directory this content gets created in, somewhere
> other then ~/ then we could allow the access and continue to run with
> confinement.

~/Pictures would be a sane default. I imagine that'd have to be implemented in remote viewer.

Comment 10 Miroslav Grepl 2012-09-27 10:44:36 UTC
setsebool -P unconfined_mozilla_plugin_transition 0

needs to be executed in this case.

Comment 11 Daniel Walsh 2012-09-28 09:50:44 UTC
So spice-xpi needs to be added to the mozplugin.