Bug 783687

Summary: SELinux is preventing /bin/rm from 'write' accesses on the dossier cur.
Product: [Fedora] Fedora Reporter: Nicolas Mailhot <nicolas.mailhot>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:c2b6b5c1d5c219c9a0fa584d1d30f6918b6516c0a0db60d6278c1d46018284a7
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-24 16:40:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Nicolas Mailhot 2012-01-21 18:03:11 UTC
libreport version: 2.0.8
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.2.1-8.fc17.x86_64
reason:         SELinux is preventing /bin/rm from 'write' accesses on the dossier cur.
time:           sam. 21 janv. 2012 18:55:48 CET

description:
:SELinux is preventing /bin/rm from 'write' accesses on the dossier cur.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that rm should be allowed write access on the cur directory 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:system_cronjob_t:s0-s0:c0.c1023
:Target Context                unconfined_u:object_r:data_home_t:s0
:Target Objects                cur [ dir ]
:Source                        rm
:Source Path                   /bin/rm
:Port                          <Inconnu>
:Host                          (removed)
:Source RPM Packages           coreutils-8.15-2.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-76.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Permissive
:Host Name                     (removed)
:Platform                      Linux (removed) 3.2.1-5.fc17.x86_64 #1 SMP Tue Jan
:                              17 18:57:18 UTC 2012 x86_64 x86_64
:Alert Count                   3
:First Seen                    sam. 21 janv. 2012 17:00:05 CET
:Last Seen                     sam. 21 janv. 2012 17:00:17 CET
:Local ID                      bae87afb-c088-46a3-8d37-a12cb1cd8a88
:
:Raw Audit Messages
:type=AVC msg=audit(1327161617.702:425): avc:  denied  { write } for  pid=5778 comm="rm" name="cur" dev=dm-0 ino=64703 scontext=system_u:system_r:system_cronjob_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:data_home_t:s0 tclass=dirnode=(removed) type=AVC msg=audit(1327161617.702:425): avc:  denied  { remove_name } for  pid=5778 comm="rm" name="1327052725.M107142P32410.(removed),S=27217,W=27642:2," dev=dm-0 ino=47520 scontext=system_u:system_r:system_cronjob_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:data_home_t:s0 tclass=dir
:
:
:type=AVC msg=audit(1327161617.702:425): avc:  denied  { unlink } for  pid=5778 comm="rm" name="1327052725.M107142P32410.(removed),S=27217,W=27642:2," dev=dm-0 ino=47520 scontext=system_u:system_r:system_cronjob_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:data_home_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1327161617.702:425): arch=x86_64 syscall=unlinkat success=yes exit=0 a0=ffffffffffffff9c a1=14be0f0 a2=0 a3=7fff3576c760 items=0 ppid=4991 pid=5778 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=8 comm=rm exe=/bin/rm subj=system_u:system_r:system_cronjob_t:s0-s0:c0.c1023 key=(null)
:
:Hash: rm,system_cronjob_t,data_home_t,dir,write
:
:audit2allow
:
:#============= system_cronjob_t ==============
:#!!!! The source type 'system_cronjob_t' can write to a 'dir' of the following types:
:# system_cronjob_var_lib_t, unlabeled_t, proc_type, crond_tmp_t, filesystem_type, sysstat_log_t, var_spool_t, httpd_cache_t, var_lib_t, var_run_t, system_cron_spool_t, sysctl_type, var_log_t, spamc_home_t, cyrus_var_lib_t, file_type, innd_var_run_t, spamd_var_lib_t, prelink_log_t, prelink_var_lib_t, var_lock_t, man_t, user_home_dir_t, root_t, tmp_t, innd_log_t, etc_t, root_t
:
:allow system_cronjob_t data_home_t:dir { write remove_name };
:allow system_cronjob_t data_home_t:file unlink;
:
:audit2allow -R
:
:#============= system_cronjob_t ==============
:#!!!! The source type 'system_cronjob_t' can write to a 'dir' of the following types:
:# system_cronjob_var_lib_t, unlabeled_t, proc_type, crond_tmp_t, filesystem_type, sysstat_log_t, var_spool_t, httpd_cache_t, var_lib_t, var_run_t, system_cron_spool_t, sysctl_type, var_log_t, spamc_home_t, cyrus_var_lib_t, file_type, innd_var_run_t, spamd_var_lib_t, prelink_log_t, prelink_var_lib_t, var_lock_t, man_t, user_home_dir_t, root_t, tmp_t, innd_log_t, etc_t, root_t
:
:allow system_cronjob_t data_home_t:dir { write remove_name };
:allow system_cronjob_t data_home_t:file unlink;
:

Comment 1 Miroslav Grepl 2012-01-23 11:04:46 UTC
*** Bug 783688 has been marked as a duplicate of this bug. ***

Comment 2 Miroslav Grepl 2012-01-23 11:04:58 UTC
*** Bug 783689 has been marked as a duplicate of this bug. ***

Comment 3 Miroslav Grepl 2012-01-23 11:08:29 UTC
Did you setup a cron job? I don't think this happened by default.

Comment 4 Miroslav Grepl 2012-01-23 11:08:52 UTC
*** Bug 783690 has been marked as a duplicate of this bug. ***

Comment 5 Nicolas Mailhot 2012-01-23 14:07:45 UTC
(In reply to comment #3)
> Did you setup a cron job? I don't think this happened by default.

I have a cron job that collects user's spam every day

Comment 6 Daniel Walsh 2012-01-24 16:40:16 UTC
You have a system cron job that removes content from users homedirs, I think you will have to add custom policy to make this work.  Or write a policy for your job,  But this is not something we want to allow out of the box.