Bug 1301007

Summary: Cron cannot load user crontab due to SELinux denial
Product: [Fedora] Fedora Reporter: Martin Kosek <mkosek>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-22 10:41:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Kosek 2016-01-22 10:14:59 UTC
Description of problem:
After I rebooted my laptop on Jan 19, 2016, cron stopped executing my crontab as it failed to load the user crontab:

$ systemctl status crond.service -l
● crond.service - Command Scheduler
   Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2016-01-22 11:04:49 CET; 1min 44s ago
 Main PID: 31151 (crond)
   CGroup: /system.slice/crond.service
           └─31151 /usr/sbin/crond -n

Jan 22 11:04:49 xxxxx.redhat.com systemd[1]: Started Command Scheduler.
Jan 22 11:04:49 xxxxx.redhat.com systemd[1]: Starting Command Scheduler...
Jan 22 11:04:49 xxxxx.redhat.com crond[31151]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 81% if used.)
Jan 22 11:04:49 xxxxx.redhat.com crond[31151]: (mkosek) Unauthorized SELinux context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 file_context=unconfined_u:object_r:user_cron_spool_t:s0 (/var/spool/cron/mkosek)
Jan 22 11:04:49 xxxxx.redhat.com crond[31151]: (mkosek) FAILED (loading cron table)
Jan 22 11:04:49 xxxxx.redhat.com crond[31151]: (CRON) INFO (running with inotify support)
Jan 22 11:04:49 xxxxx.redhat.com crond[31151]: (CRON) INFO (@reboot jobs will be run at computer's startup.)


$ getsebool cron_userdomain_transition
cron_userdomain_transition --> on

$ sudo ls -laZ /var/spool/cron/
total 12
drwx------.  2 root   root   system_u:object_r:user_cron_spool_t:s0     4096 Jul 13  2015 .
drwxr-xr-x. 13 root   root   system_u:object_r:var_spool_t:s0           4096 Sep 10 10:23 ..
-rw-------.  1 mkosek mkosek unconfined_u:object_r:user_cron_spool_t:s0  634 Feb  4  2015 mkosek

$ sudo ausearch -m AVC -ts today
<no matches>


Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-158.fc23.noarch
cronie-1.5.0-3.fc23.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Restart crond
2.
3.

Actual results:
Fails to load user crontab

Expected results:
Loads user crontab

Additional info:
I saw Bug 1052401 and Bug 1063503, but I did not see any useful information helping me continue run in the enforcing mode.

Comment 1 Petr Lautrbach 2016-01-22 10:22:11 UTC
It seems to be duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1298192 . The kernel-4.3.3-303.fc23 https://bodhi.fedoraproject.org/updates/FEDORA-2016-b59fd603be should fix your problem

Comment 2 Petr Lautrbach 2016-01-22 10:41:06 UTC
It the kernel doesn't fix your problem feel free to reopen this bug.

*** This bug has been marked as a duplicate of bug 1298192 ***