Bug 217860

Summary: SELinux issue with prelink
Product: [Fedora] Fedora Reporter: vfiend
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: jakub
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Current Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-22 14:12:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description vfiend 2006-11-30 14:14:40 UTC
Summary
    SELinux is preventing /usr/sbin/prelink (prelink_t) "read" to nethack
    (usr_t).

Detailed Description
    SELinux denied access requested by /usr/sbin/prelink. It is not expected
    that this access is required by /usr/sbin/prelink 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 nethack, restorecon -v nethack
    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 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
    http://bugzilla.redhat.com/bugzilla/enter_bug.cgi against this package.

Additional Information:       

Source Context:               system_u:system_r:prelink_t
Target Context:               system_u:object_r:usr_t
Target Objects:               nethack [ file ]
Affected RPM Packages:        prelink-0.3.9-2 [application]
Policy RPM:                   selinux-policy-2.4.5-3.fc6
Selinux Enabled:              True
Policy Type:                  targeted
MLS Enabled:                  True
Enforcing Mode:               Enforcing
Plugin Name:                  plugins.catchall_file
Host Name:                    icarus
Platform:                     Linux icarus 2.6.18-1.2849.fc6 #1 SMP Fri Nov 10
12:34:46 EST 2006 x86_64 x86_64
Alert Count:                  1
Line Numbers:                 

Raw Audit Messages:           

avc: denied { read } for comm="prelink" dev=dm-0 egid=0 euid=0
exe="/usr/sbin/prelink" exit=-13 fsgid=0 fsuid=0 gid=0 items=0 name="nethack"
pid=7939 scontext=system_u:system_r:prelink_t:s0 sgid=0
subj=system_u:system_r:prelink_t:s0 suid=0 tclass=file
tcontext=system_u:object_r:usr_t:s0 tty=(none) uid=0

Comment 1 Daniel Walsh 2006-11-30 17:47:07 UTC
Where is nethack installed?  How is it labeled?

ls -lZ nethack

It should be labeled bin_t.

chcon -t bin_t nethack

Comment 2 vfiend 2006-11-30 17:52:54 UTC
$ which nethack
/usr/bin/nethack
$ ls -lZ /usr/bin/nethack
-rwxr-xr-x  root root system_u:object_r:bin_t          /usr/bin/nethack


Comment 3 Daniel Walsh 2006-11-30 18:42:35 UTC
Prelink is looking at a different one which is labeled usr_t.

Comment 4 vfiend 2006-11-30 19:54:22 UTC
$ ls -lZ /usr/games/nethack-3.4.3/nethack
-rwxr-sr-x  root games system_u:object_r:usr_t         
/usr/games/nethack-3.4.3/nethack

Ah. So the bug is with the Fedora Extras nethack rpm, I guess

Comment 5 Daniel Walsh 2006-12-01 21:51:45 UTC
Fixed in selinux-policy-2.4.6-5

Comment 6 Daniel Walsh 2007-08-22 14:12:35 UTC
Fixed in current release