Bug 443874

Summary: Selinux prevents user from access to crontab
Product: [Fedora] Fedora Reporter: Adrian "Adi1981" P. <adi1981.2k5>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: rawhideCC: jkubin
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-25 01:51:45 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 235706    

Description Adrian "Adi1981" P. 2008-04-23 15:50:01 EDT
Description of problem:
With selinux in enforcing mode (policy targeted):

[root@localhost ~]# crontab -u adi
Access denied by SELinux, must be privileged to use -u

[adi@localhost ~]$ crontab -l
cron/adi: Brak dostępu (means: no access)

After setting selinux into permissive mode, everything works fine, crontab is
accessible from user and root accounts. Also crontab for root works fine.

Version-Release number of selected component (if applicable):
[adi@localhost ~]$ kto selinux
libselinux-2.0.61-1.fc9.i386
selinux-policy-devel-3.3.1-35.fc9.noarch
selinux-policy-3.3.1-35.fc9.noarch
selinux-policy-targeted-3.3.1-35.fc9.noarch
libselinux-python-2.0.61-1.fc9.i386
libselinux-devel-2.0.61-1.fc9.i386

How reproducible:
Always

Steps to Reproduce:
1. Just try to edit crontab with targeted policy

audit.log: 
# cat /var/log/audit/audit.log |grep cron |grep denied
type=AVC msg=audit(1208979004.795:103): avc:  denied  { unlink } for  pid=26489
comm="crontab" name="adi" dev=sda10 ino=72247
scontext=unconfined_u:unconfined_r:unconfined_crontab_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:cron_spool_t:s0 tclass=file
type=AVC msg=audit(1208979243.688:105): avc:  denied  { read } for  pid=28028
comm="crontab" name="adi" dev=sda10 ino=72247
scontext=unconfined_u:unconfined_r:unconfined_crontab_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:cron_spool_t:s0 tclass=file
type=AVC msg=audit(1208979407.168:112): avc:  denied  { read } for  pid=29086
comm="crontab" name="perms" dev=selinuxfs ino=67111366
scontext=unconfined_u:unconfined_r:unconfined_crontab_t:s0-s0:c0.c1023
tcontext=system_u:object_r:security_t:s0 tclass=dir
type=AVC msg=audit(1208979407.168:113): avc:  denied  { write } for  pid=29086
comm="crontab" name="access" dev=selinuxfs ino=6
scontext=unconfined_u:unconfined_r:unconfined_crontab_t:s0-s0:c0.c1023
tcontext=system_u:object_r:security_t:s0 tclass=file
type=AVC msg=audit(1208979407.169:114): avc:  denied  { compute_av } for 
pid=29086 comm="crontab"
scontext=unconfined_u:unconfined_r:unconfined_crontab_t:s0-s0:c0.c1023
tcontext=system_u:object_r:security_t:s0 tclass=security
type=AVC msg=audit(1208979410.577:116): avc:  denied  { read } for  pid=29097
comm="crontab" name="adi" dev=sda10 ino=72247
scontext=unconfined_u:unconfined_r:unconfined_crontab_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:cron_spool_t:s0 tclass=file
type=AVC msg=audit(1208979410.578:117): avc:  denied  { getattr } for  pid=29097
comm="crontab" path="/var/spool/cron/adi" dev=sda10 ino=72247
scontext=unconfined_u:unconfined_r:unconfined_crontab_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:cron_spool_t:s0 tclass=file
type=AVC msg=audit(1208979844.363:126): avc:  denied  { read } for  pid=31864
comm="crontab" name="adi" dev=sda10 ino=72247
scontext=unconfined_u:unconfined_r:unconfined_crontab_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:cron_spool_t:s0 tclass=file
Comment 1 Adrian "Adi1981" P. 2008-04-23 15:51:46 EDT
s/Also crontab for root works fine/Also crontab for root works fine in enforcing
mode/
Comment 2 Adrian "Adi1981" P. 2008-04-25 01:51:45 EDT
Fixed in -41, confirm that everything works fine now.
Comment 3 Adrian "Adi1981" P. 2008-04-25 01:53:05 EDT
Argh.. closed by mistake.