Bug 467615

Summary: npviewer selinux problems with automounted directories
Product: [Fedora] Fedora Reporter: Jeff Layton <jlayton>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: caillon, steved, stransky, wtogami
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-27 14:08:47 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:
Bug Depends On:    
Bug Blocks: 438943    

Description Jeff Layton 2008-10-19 13:59:27 UTC
Getting a ton of these alerts when I hit certain pages in firefox. Mostly these are pages that use the binary flash plugin. My /home is managed by autofs. The inode number in the avc alert matches the one here:

# stat -Z /home
  File: `/home'
  Size: 0         	Blocks: 0          IO Block: 1024   directory
Device: 14h/20d	Inode: 9080        Links: 3     Device type: 0,0
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
   S_Context: system_u:object_r:autofs_t:s0
Access: 2008-10-19 09:58:17.771183790 -0400
Modify: 2008-10-19 08:30:21.869180492 -0400
Change: 2008-10-19 08:30:04.456173061 -0400

------------------[snip]--------------------

Summary:

SELinux is preventing npviewer.bin (nsplugin_t) "search" to / (autofs_t).

Detailed Description:

SELinux denied access requested by npviewer.bin. It is not expected that this
access is required by npviewer.bin 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:

Sometimes labeling problems can cause SELinux denials. You could try to restore
the default system file context for /,

restorecon -v '/'

If this does not work, there is currently no automatic way to allow this access.
Instead, you can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable
SELinux protection altogether. Disabling SELinux protection is not recommended.
Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi)
against this package.

Additional Information:

Source Context                unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c102
                              3
Target Context                system_u:object_r:autofs_t:s0
Target Objects                / [ dir ]
Source                        npviewer.bin
Source Path                   /usr/lib/nspluginwrapper/npviewer.bin
Port                          <Unknown>
Host                          tleilax.poochiereds.net
Source RPM Packages           nspluginwrapper-1.1.2-2.fc10
Target RPM Packages           filesystem-2.4.19-1.fc10
Policy RPM                    selinux-policy-3.5.13-1.fc10
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall_file
Host Name                     tleilax.poochiereds.net
Platform                      Linux tleilax.poochiereds.net
                              2.6.27.2-23.rc1.fc10.x86_64 #1 SMP Thu Oct 16
                              23:42:46 EDT 2008 x86_64 x86_64
Alert Count                   893
First Seen                    Sun 19 Oct 2008 07:48:40 AM EDT
Last Seen                     Sun 19 Oct 2008 09:00:29 AM EDT
Local ID                      ecea1c12-2070-4ef7-862f-363bb6613b11
Line Numbers                  

Raw Audit Messages            

node=tleilax.poochiereds.net type=AVC msg=audit(1224421229.208:941): avc:  denied  { search } for  pid=3921 comm="npviewer.bin" name="/" dev=autofs ino=9080 scontext=unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c1023 tcontext=system_u:object_r:autofs_t:s0 tclass=dir

node=tleilax.poochiereds.net type=SYSCALL msg=audit(1224421229.208:941): arch=40000003 syscall=195 per=8 success=no exit=-13 a0=f6f582f8 a1=ff860e24 a2=c80ff4 a3=ff860ffc items=0 ppid=3879 pid=3921 auid=4447 uid=4447 gid=4447 euid=4447 suid=4447 fsuid=4447 egid=4447 sgid=4447 fsgid=4447 tty=(none) ses=1 comm="npviewer.bin" exe="/usr/lib/nspluginwrapper/npviewer.bin" subj=unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c1023 key=(null)

Comment 1 Daniel Walsh 2008-10-23 14:38:02 UTC
You can allow this for now.

# audit2allow -M mypol -l -i /var/log/audit/audit.log
# semodule -i mypol.pp

Fixed in selinux-policy-3.5.13-6.fc10

Comment 2 Jeff Layton 2008-10-24 20:27:11 UTC
Thanks Dan. The new package seems to have fixed that one, but I've now noticed two more. These aren't as frequent as the other one, but they seem to pop whenever firefox is started:

-----------------------------------------------------------------------------
Summary:

SELinux is preventing which (nsplugin_config_t) "search" to / (autofs_t).

Detailed Description:

SELinux denied access requested by which. It is not expected that this access is
required by which 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:

Sometimes labeling problems can cause SELinux denials. You could try to restore
the default system file context for /,

restorecon -v '/'

If this does not work, there is currently no automatic way to allow this access.
Instead, you can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable
SELinux protection altogether. Disabling SELinux protection is not recommended.
Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi)
against this package.

Additional Information:

Source Context                unconfined_u:unconfined_r:nsplugin_config_t:s0-s0:
                              c0.c1023
Target Context                system_u:object_r:autofs_t:s0
Target Objects                / [ dir ]
Source                        npviewer
Source Path                   /bin/bash
Port                          <Unknown>
Host                          tleilax.poochiereds.net
Source RPM Packages           which-2.19-3.fc9
Target RPM Packages           filesystem-2.4.19-1.fc10
Policy RPM                    selinux-policy-3.5.13-7.fc10
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall_file
Host Name                     tleilax.poochiereds.net
Platform                      Linux tleilax.poochiereds.net
                              2.6.27.3-39.fc10.x86_64 #1 SMP Wed Oct 22 21:04:28
                              EDT 2008 x86_64 x86_64
Alert Count                   199
First Seen                    Sun 19 Oct 2008 07:48:39 AM EDT
Last Seen                     Fri 24 Oct 2008 04:24:18 PM EDT
Local ID                      22a52ac7-53eb-4ed7-8f3f-4b9ad22370d7
Line Numbers                  

Raw Audit Messages            

node=tleilax.poochiereds.net type=AVC msg=audit(1224879858.16:61): avc:  denied  { search } for  pid=3462 comm="which" name="/" dev=autofs ino=9233 scontext=unconfined_u:unconfined_r:nsplugin_config_t:s0-s0:c0.c1023 tcontext=system_u:object_r:autofs_t:s0 tclass=dir

node=tleilax.poochiereds.net type=SYSCALL msg=audit(1224879858.16:61): arch=c000003e syscall=4 success=no exit=-13 a0=eba030 a1=7fff4c10a080 a2=7fff4c10a080 a3=3b7556da70 items=0 ppid=3459 pid=3462 auid=4447 uid=4447 gid=4447 euid=4447 suid=4447 fsuid=4447 egid=4447 sgid=4447 fsgid=4447 tty=(none) ses=1 comm="which" exe="/usr/bin/which" subj=unconfined_u:unconfined_r:nsplugin_config_t:s0-s0:c0.c1023 key=(null)


---------------------------------------------------------------------------
Summary:

SELinux is preventing linux32 (nsplugin_config_t) "execute" to ./npviewer.bin
(execmem_exec_t).

Detailed Description:

SELinux denied access requested by linux32. It is not expected that this access
is required by linux32 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:

Sometimes labeling problems can cause SELinux denials. You could try to restore
the default system file context for ./npviewer.bin,

restorecon -v './npviewer.bin'

If this does not work, there is currently no automatic way to allow this access.
Instead, you can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable
SELinux protection altogether. Disabling SELinux protection is not recommended.
Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi)
against this package.

Additional Information:

Source Context                unconfined_u:unconfined_r:nsplugin_config_t:s0-s0:
                              c0.c1023
Target Context                system_u:object_r:execmem_exec_t:s0
Target Objects                ./npviewer.bin [ file ]
Source                        linux32
Source Path                   /usr/bin/setarch
Port                          <Unknown>
Host                          tleilax.poochiereds.net
Source RPM Packages           util-linux-ng-2.14.1-3.fc10
Target RPM Packages           
Policy RPM                    selinux-policy-3.5.13-7.fc10
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall_file
Host Name                     tleilax.poochiereds.net
Platform                      Linux tleilax.poochiereds.net
                              2.6.27.3-39.fc10.x86_64 #1 SMP Wed Oct 22 21:04:28
                              EDT 2008 x86_64 x86_64
Alert Count                   38
First Seen                    Fri 24 Oct 2008 06:48:27 AM EDT
Last Seen                     Fri 24 Oct 2008 04:24:18 PM EDT
Local ID                      cb2cfeeb-ba6a-4f90-837c-4599972d119a
Line Numbers                  

Raw Audit Messages            

node=tleilax.poochiereds.net type=AVC msg=audit(1224879858.19:62): avc:  denied  { execute } for  pid=3459 comm="linux32" name="npviewer.bin" dev=dm-2 ino=459210 scontext=unconfined_u:unconfined_r:nsplugin_config_t:s0-s0:c0.c1023 tcontext=system_u:object_r:execmem_exec_t:s0 tclass=file

node=tleilax.poochiereds.net type=SYSCALL msg=audit(1224879858.19:62): arch=c000003e syscall=59 per=8 success=no exit=-13 a0=7fff24987995 a1=7fff24986060 a2=7fff24986088 a3=fefefefefefefeff items=0 ppid=3452 pid=3459 auid=4447 uid=4447 gid=4447 euid=4447 suid=4447 fsuid=4447 egid=4447 sgid=4447 fsgid=4447 tty=(none) ses=1 comm="linux32" exe="/usr/bin/setarch" subj=unconfined_u:unconfined_r:nsplugin_config_t:s0-s0:c0.c1023 key=(null)

Comment 3 Daniel Walsh 2008-10-27 14:08:47 UTC
nsplugin_config searching automount is fixed in selinux-policy-3.5.13-9.fc10,

but the execute execmem_exex_t on linux32 seems to be a locally modified change on your system.  linux32/setarch should not be labeled execmem_exec_t.