Bug 981734 - SELinux is preventing /usr/bin/rm from 'unlink' accesses on the file /etc/prelink.cache.
SELinux is preventing /usr/bin/rm from 'unlink' accesses on the file /etc/pre...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
19
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
abrt_hash:a1eb7ac95f9934360795b166127...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-05 11:59 EDT by mov_ebpesp
Modified: 2013-07-09 17:30 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-09 17:30:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description mov_ebpesp 2013-07-05 11:59:25 EDT
Description of problem:
SELinux is preventing /usr/bin/rm from 'unlink' accesses on the file /etc/prelink.cache.

*****  Plugin restorecon (94.8 confidence) suggests  *************************

If you want to fix the label. 
/etc/prelink.cache default label should be prelink_cache_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /etc/prelink.cache

*****  Plugin catchall_labels (5.21 confidence) suggests  ********************

If you want to allow rm to have unlink access on the prelink.cache file
Then you need to change the label on /etc/prelink.cache
Do
# semanage fcontext -a -t FILE_TYPE '/etc/prelink.cache'
where FILE_TYPE is one of the following: prelink_cache_t, prelink_log_t, prelink_var_lib_t, systemd_passwd_var_run_t. 
Then execute: 
restorecon -v '/etc/prelink.cache'


*****  Plugin catchall (1.44 confidence) suggests  ***************************

If you believe that rm should be allowed unlink access on the prelink.cache 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 rm /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:prelink_cron_system_t:s0-s0:c0.c
                              1023
Target Context                unconfined_u:object_r:etc_t:s0
Target Objects                /etc/prelink.cache [ file ]
Source                        rm
Source Path                   /usr/bin/rm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           coreutils-8.21-11.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-57.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.8-300.fc19.x86_64 #1 SMP Thu
                              Jun 27 19:24:23 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-07-05 03:17:04 CEST
Last Seen                     2013-07-05 03:17:04 CEST
Local ID                      7357428f-1e12-4468-8d09-52ae25f839ba

Raw Audit Messages
type=AVC msg=audit(1372987024.175:488): avc:  denied  { unlink } for  pid=11347 comm="rm" name="prelink.cache" dev="dm-1" ino=265012 scontext=system_u:system_r:prelink_cron_system_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file


type=SYSCALL msg=audit(1372987024.175:488): arch=x86_64 syscall=unlinkat success=no exit=EACCES a0=ffffffffffffff9c a1=17d80c0 a2=0 a3=ffffe000 items=0 ppid=11344 pid=11347 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=6 tty=(none) comm=rm exe=/usr/bin/rm subj=system_u:system_r:prelink_cron_system_t:s0-s0:c0.c1023 key=(null)

Hash: rm,prelink_cron_system_t,etc_t,file,unlink

Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.8-300.fc19.x86_64
type:           libreport

Potential duplicate: bug 896308
Comment 1 Daniel Walsh 2013-07-09 17:30:20 EDT
Alert tells you what to do.


If you want to fix the label. 
/etc/prelink.cache default label should be prelink_cache_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /etc/prelink.cache

Any idea how this file got created with the wrong label?

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