Bug 680295

Summary: SELinux is preventing /lib/upstart/shutdown from 'read' accesses on the file shutdown.pid.
Product: [Fedora] Fedora Reporter: hulyom
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:42f0eb015f1c0b566e19dfdc6ec640796a28370691b079cccc5e4913946e4306
Fixed In Version: selinux-policy-3.9.7-37.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-22 18:52:19 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 hulyom 2011-02-24 23:08:37 UTC
SELinux is preventing /lib/upstart/shutdown from 'read' accesses on the file shutdown.pid.

*****  Plugin catchall (100. confidence) suggests  ***************************

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

Additional Information:
Source Context                unconfined_u:unconfined_r:shutdown_t:s0-s0:c0.c102
                              3
Target Context                system_u:object_r:cron_var_run_t:s0
Target Objects                shutdown.pid [ file ]
Source                        shutdown
Source Path                   /lib/upstart/shutdown
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           upstart-0.6.5-10.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-29.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.11-83.fc14.x86_64 #1 SMP Mon
                              Feb 7 07:06:44 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Wed 23 Feb 2011 23:21:20 ECT
Last Seen                     Wed 23 Feb 2011 23:21:20 ECT
Local ID                      3c366d49-cca9-43bd-8c2d-9e8d95c3a30c

Raw Audit Messages
type=AVC msg=audit(1298521280.821:37): avc:  denied  { read } for  pid=3904 comm="shutdown" name="shutdown.pid" dev=dm-0 ino=393910 scontext=unconfined_u:unconfined_r:shutdown_t:s0-s0:c0.c1023 tcontext=system_u:object_r:cron_var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1298521280.821:37): arch=x86_64 syscall=open success=no exit=EACCES a0=1892440 a1=0 a2=1b6 a3=0 items=0 ppid=3864 pid=3904 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm=shutdown exe=/lib/upstart/shutdown subj=unconfined_u:unconfined_r:shutdown_t:s0-s0:c0.c1023 key=(null)

Hash: shutdown,shutdown_t,cron_var_run_t,file,read

audit2allow

#============= shutdown_t ==============
allow shutdown_t cron_var_run_t:file read;

audit2allow -R

#============= shutdown_t ==============
allow shutdown_t cron_var_run_t:file read;

Comment 1 Miroslav Grepl 2011-02-25 08:20:40 UTC
shutdown.pid file got the bad label. Do you run shutdown using cron?

Comment 2 Daniel Walsh 2011-02-25 15:03:00 UTC
After two hours shut the machine down...

Comment 3 hulyom 2011-02-25 15:20:42 UTC
Yes, I do have a cron job which turns the machine off
 #shutdown -h 3
but I executed the command
 #shutdown -c 
to cancel it but it didn't because of SElinux

Comment 4 Daniel Walsh 2011-02-25 15:50:08 UTC
Looks like we need to make shutdown a cron job.

ptional_policy(`
	cron_system_entry(shutdown_t, shutdown_exec_t)
')

Miroslav add to F13/RHEL6 also.

Comment 5 hulyom 2011-02-25 17:35:46 UTC
I don't know what that is, but sounds great, thanks :)

Comment 6 Miroslav Grepl 2011-03-08 00:00:01 UTC
Fixed in selinux-policy-3.9.7-33.fc14

Comment 7 Fedora Update System 2011-03-18 15:07:18 UTC
selinux-policy-3.9.7-34.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-34.fc14

Comment 8 Fedora Update System 2011-03-21 08:45:16 UTC
selinux-policy-3.9.7-37.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-37.fc14

Comment 9 Fedora Update System 2011-03-22 18:50:52 UTC
selinux-policy-3.9.7-37.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.