Bug 639808 - SELinux is preventing /usr/lib64/firefox-3.6/firefox "read" access on /usr/lib64/mozilla/plugins-wrapped/nswrapper_64_64.libgnashplugin.so.
Summary: SELinux is preventing /usr/lib64/firefox-3.6/firefox "read" access on /u...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 13
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:2d6015528c0...
: 603610 627130 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-04 05:13 UTC by Amit Shah
Modified: 2011-06-06 07:20 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-06-06 07:20:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Amit Shah 2010-10-04 05:13:19 UTC
Summary:

SELinux is preventing /usr/lib64/firefox-3.6/firefox "read" access on
/usr/lib64/mozilla/plugins-wrapped/nswrapper_64_64.libgnashplugin.so.

Detailed Description:

SELinux denied access requested by firefox. It is not expected that this access
is required by firefox and this access may signal an intrusion attempt. It is
also possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                unconfined_u:unconfined_r:sandbox_web_client_t:s0:
                              c473,c680
Target Context                unconfined_u:object_r:nsplugin_rw_t:s0:c159,c430
Target Objects                /usr/lib64/mozilla/plugins-
                              wrapped/nswrapper_64_64.libgnashplugin.so [ file ]
Source                        firefox
Source Path                   /usr/lib64/firefox-3.6/firefox
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           firefox-3.6.10-1.fc13
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-57.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.34.7-56.fc13.x86_64 #1 SMP Wed Sep 15 03:36:55
                              UTC 2010 x86_64 x86_64
Alert Count                   2
First Seen                    Mon 04 Oct 2010 10:42:32 AM IST
Last Seen                     Mon 04 Oct 2010 10:42:32 AM IST
Local ID                      7222a2d7-55e3-4c05-b665-c5f36643351d
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1286169152.736:65): avc:  denied  { read } for  pid=3495 comm="firefox" name="nswrapper_64_64.libgnashplugin.so" dev=dm-3 ino=790178 scontext=unconfined_u:unconfined_r:sandbox_web_client_t:s0:c473,c680 tcontext=unconfined_u:object_r:nsplugin_rw_t:s0:c159,c430 tclass=file

node=(removed) type=SYSCALL msg=audit(1286169152.736:65): arch=c000003e syscall=2 success=no exit=-13 a0=7f3b52aed240 a1=0 a2=0 a3=6967756c70687361 items=0 ppid=3449 pid=3495 auid=500 uid=500 gid=501 euid=500 suid=500 fsuid=500 egid=501 sgid=501 fsgid=501 tty=(none) ses=1 comm="firefox" exe="/usr/lib64/firefox-3.6/firefox" subj=unconfined_u:unconfined_r:sandbox_web_client_t:s0:c473,c680 key=(null)



Hash String generated from  catchall,firefox,sandbox_web_client_t,nsplugin_rw_t,file,read
audit2allow suggests:

#============= sandbox_web_client_t ==============
#!!!! This avc is a constraint violation.  You will need to add an attribute to either the source or target type to make it work.
#Contraint rule: 
allow sandbox_web_client_t nsplugin_rw_t:file read;

Comment 1 Miroslav Grepl 2010-10-04 08:55:04 UTC
Amit,
how did you get it? I guess you ran

# sandbox -X -t sandbox_web_t firefox

and then you ran flash. But did you do any additional steps to reproduce. 

I am not seeing it with these steps to reproduce

# sandbox -X -t sandbox_web_t firefox
# navigate to a website that plays audio (I used youtube)
# rpm -qa pulseaudio policycoreutils-\* 
policycoreutils-python-2.0.83-28.fc13.x86_64
pulseaudio-0.9.21-6.fc13.x86_64
policycoreutils-gui-2.0.83-28.fc13.x86_64
policycoreutils-newrole-2.0.83-28.fc13.x86_64
policycoreutils-debuginfo-2.0.83-24.fc13.x86_64
policycoreutils-sandbox-2.0.83-28.fc13.x86_6


I am using flash-plugin 64-bit Preview Release.

http://fedoraproject.org/wiki/Flash

Comment 2 Miroslav Grepl 2010-10-04 08:56:49 UTC
*** Bug 627130 has been marked as a duplicate of this bug. ***

Comment 3 Miroslav Grepl 2010-10-04 08:57:56 UTC
*** Bug 603610 has been marked as a duplicate of this bug. ***

Comment 4 Amit Shah 2010-10-04 09:07:28 UTC
I didn't even have to go to a flash-based site.  I just do this:

sandbox -X -t sandbox_web_t firefox about:blank

and the errors trigger (read, write, read-execute, unlink errors -- 4 avc denials in all).

I don't use the Flash plugin, I use the gnash plugin, so maybe it's related to that.

Comment 5 Miroslav Grepl 2010-10-04 10:50:17 UTC
Ok, 
could you add your output of the following command

# ls -lZ /usr/lib64/mozilla/plugins-wrapped/nswrapper_*

Comment 6 Amit Shah 2010-10-04 10:59:58 UTC
$ ls -lZ /usr/lib64/mozilla/plugins-wrapped/nswrapper_*
-rwxr-xr-x. root amit unconfined_u:object_r:nsplugin_rw_t:s0:c159,c430 /usr/lib64/mozilla/plugins-wrapped/nswrapper_64_64.libgnashplugin.so

Comment 7 Amit Shah 2010-10-04 11:04:08 UTC
Surprising: why is the file owned by group 'amit'?  I installed the plugin from the package from koji, which hasn't yet made it to the F13 repos.

Comment 8 Miroslav Grepl 2010-10-04 11:33:35 UTC
Ok, the problem is the following label

nsplugin_rw_t:s0:c159,c430

# restorecon -R -v /usr/lib64/mozilla/plugins-wrapped

Should fix.

Did you install the plugin inside of sandbox?

Comment 9 Amit Shah 2010-10-04 11:56:11 UTC
No, I didn't install it in a sandbox.

Is this a packaging issue?

Comment 10 Daniel Walsh 2010-10-04 15:08:45 UTC
Did you run sandbox firefox as root?  

Some how you were able to write content to a root directory while running in a sandbox.

Comment 11 Daniel Walsh 2010-10-04 15:09:06 UTC
Reopen if you figured out how this happened.

Comment 12 Amit Shah 2010-10-05 11:54:33 UTC
(In reply to comment #10)
> Did you run sandbox firefox as root?  

No, I didn't.

> Some how you were able to write content to a root directory while running in a
> sandbox.

That's scary -- I didn't do this so is there a security bug somewhere?

(So leave it opened till we actually establish it's user error rather than something else going bad?)

Comment 13 Daniel Walsh 2010-10-05 13:15:00 UTC
Did you run sandbox while in permissive mode?  Is there a chance that a setuid/setgid app created this file while in a sandbox in permissive mode?

How did you install libgnashplugin?

Comment 14 Amit Shah 2010-10-05 13:34:33 UTC
(In reply to comment #13)
> Did you run sandbox while in permissive mode?

No.

>  Is there a chance that a
> setuid/setgid app created this file while in a sandbox in permissive mode?

No.

> 
> How did you install libgnashplugin?

From koji; the version I have fixes a bug and this update isn't yet pushed to F13.

Comment 15 Daniel Walsh 2010-10-05 13:44:54 UTC
Ok we have

	nsplugin_manage_rw(sandbox_web_type)

Which should be removed.

Since this is what caused the problem.

It is allowing sandbox to manage 

/usr/lib(64)?/mozilla/plugins-wrapped(/.*)?			gen_context(system_u:object_r:nsplugin_rw_t,s0)

ls -l /usr/lib64/nspluginwrapper/plugin-config 
-rwsr-xr-x. 1 root root 61448 Jun 30 03:49 /usr/lib64/nspluginwrapper/plugin-config

So sandbox_web was allowed to execute plugin-config which modified the permissions on this file.

Comment 16 Miroslav Grepl 2010-10-05 14:23:57 UTC
Dan,
you are right. Good catch. I will remove it.

Comment 17 Miroslav Grepl 2010-10-05 14:56:41 UTC
Fixed in selinux-policy-3.7.19-64.fc13

Comment 18 Fedora Admin XMLRPC Client 2010-11-08 21:50:14 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 19 Fedora Admin XMLRPC Client 2010-11-08 21:51:44 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 20 Fedora Admin XMLRPC Client 2010-11-08 21:53:03 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 21 Bug Zapper 2011-05-31 12:02:59 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


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