Bug 616549 - SELinux is preventing /usr/bin/perl "read" access on /usr/share/perl5/strict.pm.
Summary: SELinux is preventing /usr/bin/perl "read" access on /usr/share/perl5/st...
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy   
(Show other bugs)
Version: 13
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
Whiteboard: setroubleshoot_trace_hash:84856749b69...
Depends On:
TreeView+ depends on / blocked
Reported: 2010-07-20 18:46 UTC by Donald Edward Winslow
Modified: 2010-07-22 14:24 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-07-22 14:24:36 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Donald Edward Winslow 2010-07-20 18:46:10 UTC

SELinux is preventing /usr/bin/perl "read" access on /usr/share/perl5/strict.pm.

Detailed Description:

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

Additional Information:

Source Context                system_u:system_r:logwatch_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /usr/share/perl5/strict.pm [ file ]
Source                        logwatch
Source Path                   /usr/bin/perl
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           perl-5.10.1-114.fc13
Target RPM Packages           perl-5.10.1-114.fc13
Policy RPM                    selinux-policy-3.7.19-37.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed)
                     #1 SMP Tue Jul 6 22:32:17
                              UTC 2010 x86_64 x86_64
Alert Count                   3
First Seen                    Tue 20 Jul 2010 09:39:01 AM CDT
Last Seen                     Tue 20 Jul 2010 09:39:01 AM CDT
Local ID                      a3c72a8a-9b04-4f2a-8e3f-88b347a5ed77
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1279636741.216:280): avc:  denied  { read } for  pid=11290 comm="logwatch" name="strict.pm" dev=sda2 ino=530448 scontext=system_u:system_r:logwatch_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1279636741.216:280): arch=c000003e syscall=2 success=no exit=-13 a0=16ed870 a1=0 a2=1b6 a3=384f31d820 items=0 ppid=11284 pid=11290 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=23 comm="logwatch" exe="/usr/bin/perl" subj=system_u:system_r:logwatch_t:s0-s0:c0.c1023 key=(null)

Hash String generated from  catchall,logwatch,logwatch_t,user_home_t,file,read
audit2allow suggests:

#============= logwatch_t ==============
allow logwatch_t user_home_t:file read;

Comment 1 Daniel Walsh 2010-07-20 19:43:25 UTC
restorecon -R -v /usr/share/perl5

Any idea how this got mislabeled?  What does the output of 

matchpathcon /usr/share/perl5/strict.pm


Comment 2 Donald Edward Winslow 2010-07-20 20:14:28 UTC
I installed a bunch of perl packages I don't really need; one or more of those is probably the culprit.

Here is the output of your command:

[Donald@Zonotrichia ~]$ matchpathcon /usr/share/perl5/strict.pm
/usr/share/perl5/strict.pm	unconfined_u:object_r:user_home_t:s0
[Donald@Zonotrichia ~]$

Comment 3 Daniel Walsh 2010-07-20 20:53:09 UTC
> grep /usr/share/perl5 /etc/passwd

> grep /usr/share/perl5 /etc/selinux/targeted/contexts/files/*

Comment 4 Donald Edward Winslow 2010-07-20 22:52:26 UTC
These two commands yielded no output.

Comment 5 Daniel Walsh 2010-07-21 13:17:22 UTC
What does matchpathcon /usr/share/perl5 output?

Comment 6 Donald Edward Winslow 2010-07-21 13:36:43 UTC

Comment 7 Daniel Walsh 2010-07-21 14:07:49 UTC
Ok so something is telling perl5 it is a homedir.

getent passwd | grep share

Comment 8 Donald Edward Winslow 2010-07-21 14:26:55 UTC
[Donald@Zonotrichia ~]$ getent passwd | grep share
tomcat:x:91:91:Apache Tomcat:/usr/share/tomcat5:/bin/sh
icecast:x:472:453:icecast streaming server:/usr/share/icecast:/sbin/nologin
ajaxterm:x:464:445:Ajaxterm user:/usr/share/ajaxterm:/sbin/nologin
dansguardian:x:459:439:DansGuardian web content filter:/usr/share/dansguardian:/sbin/nologin

Comment 9 Daniel Walsh 2010-07-21 15:38:06 UTC

Is causing the problem.

Can you change its shell to /sbin/nologin?

And then run 

# genhomedircon
# restorecon -R -v /usr/share

Comment 10 Donald Edward Winslow 2010-07-21 17:43:01 UTC
I did that. Hopefully it won't change back now. Thanks for your patience with these issues, Daniel!

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