Bug 1266153 - SELinux prevents reboot from cron job
Summary: SELinux prevents reboot from cron job
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 22
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Vit Mojzis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-24 15:36 UTC by Orion Poplawski
Modified: 2016-05-10 17:56 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.13.1-128.23.fc22 selinux-policy-3.13.1-128.28.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 17:56:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Orion Poplawski 2015-09-24 15:36:06 UTC
Description of problem:

We use a cron job to reboot some machines when needed.  This is now failing with:

type=USER_AVC msg=audit(1443089508.488:3600): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  denied  { start } for auid=n/a uid=0 gid=0 path="/usr/lib/systemd/system/reboot.target" cmdline="shutdown -r now" scontext=system_u:system_r:system_cronjob_t:s0-s0:c0.c1023 tcontext=system_u:object_r:power_unit_file_t:s0 tclass=service  exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'

Version-Release number of selected component (if applicable):
selinux-policy.noarch 3.13.1-128.13.fc22

I know I can create custom policy, but would rather not have to.

Comment 1 Wolfgang Rupprecht 2015-10-14 14:41:49 UTC
I'm seeing the same thing on all my up to date fc23 beta systems.   Reboots from daily cron using "shutdown -r +3 "update for new software"' fail in a way that cause an immediate reboot.   This causes the daily cron mail to be lost as well as any other mail (like the daily rkhunter run) that was sent in the seconds before that.  That does have security and operational implications.  All problem reports from that cron run are lost.

type=AVC msg=audit(1444832764.426:1269): avc:  denied  { read } for  pid=872 comm="systemd-logind" name="utmp" dev="tmpfs" ino=16172 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:initrc_var_run_t:s0 tclass=file permissive=0
type=AVC msg=audit(1444832764.426:1270): avc:  denied  { read } for  pid=872 comm="systemd-logind" name="utmp" dev="tmpfs" ino=16172 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:initrc_var_run_t:s0 tclass=file permissive=0
type=AVC msg=audit(1444832764.426:1271): avc:  denied  { create } for  pid=872 comm="systemd-logind" name=".#scheduled1B77sJ" scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:init_var_run_t:s0 tclass=file permissive=0
type=AVC msg=audit(1444832764.427:1272): avc:  denied  { create } for  pid=872 comm="systemd-logind" name=".#nologin9MA0Jf" scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0

selinux-policy.noarch                  3.13.1-150.fc23          @updates-testing
selinux-policy-devel.noarch            3.13.1-150.fc23          @updates-testing
selinux-policy-targeted.noarch         3.13.1-150.fc23          @updates-testing

Comment 4 Wolfgang Rupprecht 2015-11-25 10:07:09 UTC
I'm not the OP but I can confirm that the following fixed the issue for me.  Thanks!  This was driving me crazy.

selinux-policy.noarch 3.13.1-155.fc23                                                   selinux-policy-devel.noarch 3.13.1-155.fc23                                                   selinux-policy-targeted.noarch 3.13.1-155.fc23

Comment 7 Fedora Update System 2016-01-18 13:19:44 UTC
selinux-policy-3.13.1-128.25.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-825869e1a4

Comment 8 Fedora Update System 2016-01-20 03:53:05 UTC
selinux-policy-3.13.1-128.25.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-825869e1a4

Comment 9 Fedora Update System 2016-02-15 17:46:24 UTC
selinux-policy-3.13.1-128.27.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ce419c9cab

Comment 10 Fedora Update System 2016-02-17 06:25:54 UTC
selinux-policy-3.13.1-128.27.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ce419c9cab

Comment 11 Fedora Update System 2016-02-18 12:27:12 UTC
selinux-policy-3.13.1-128.28.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ce419c9cab

Comment 12 Fedora Update System 2016-02-21 18:28:52 UTC
selinux-policy-3.13.1-128.28.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ce419c9cab

Comment 13 Fedora Update System 2016-05-10 17:55:37 UTC
selinux-policy-3.13.1-128.28.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.


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