Bug 680295 - SELinux is preventing /lib/upstart/shutdown from 'read' accesses on the file shutdown.pid.
Summary: SELinux is preventing /lib/upstart/shutdown from 'read' accesses on the file ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 14
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:42f0eb015f1...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-24 23:08 UTC by hulyom
Modified: 2011-03-22 18:52 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.9.7-37.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-22 18:52:19 UTC
Type: ---


Attachments (Terms of Use)

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.


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