Description of problem: SELinux is preventing sshd from 'getattr' accesses on the file /run/sshd.pid. ***** Plugin restorecon (99.5 confidence) suggests ************************ If you want to fix the label. /run/sshd.pid default label should be sshd_var_run_t. Then you can run restorecon. Do # /sbin/restorecon -v /run/sshd.pid ***** Plugin catchall (1.49 confidence) suggests ************************** If you believe that sshd should be allowed getattr access on the sshd.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 sshd /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.pp Additional Information: Source Context system_u:system_r:sshd_t:s0-s0:c0.c1023 Target Context unconfined_u:object_r:var_run_t:s0 Target Objects /run/sshd.pid [ file ] Source sshd Source Path sshd Port <Unknown> Host (removed) Source RPM Packages Target RPM Packages Policy RPM selinux-policy-3.13.1-85.fc21.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Permissive Host Name (removed) Platform Linux (removed) 3.17.0-300.fc21.x86_64+debug #1 SMP Mon Oct 6 17:08:44 UTC 2014 x86_64 x86_64 Alert Count 1 First Seen 2014-10-09 22:36:02 YEKT Last Seen 2014-10-09 22:36:02 YEKT Local ID f3b34f55-441b-498a-9db4-391f4c826280 Raw Audit Messages type=AVC msg=audit(1412872562.412:866): avc: denied { getattr } for pid=11897 comm="sshd" path="/run/sshd.pid" dev="tmpfs" ino=5363347 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file permissive=1 Hash: sshd,sshd_t,var_run_t,file,getattr Version-Release number of selected component: selinux-policy-3.13.1-85.fc21.noarch Additional info: reporter: libreport-2.2.3 hashmarkername: setroubleshoot kernel: 3.17.0-300.fc21.x86_64+debug type: libreport
***** Plugin restorecon (99.5 confidence) suggests ************************ If you want to fix the label. /run/sshd.pid default label should be sshd_var_run_t. Then you can run restorecon. Do # /sbin/restorecon -v /run/sshd.pid
The question is how it got the bad labeling. Have you ever started the sshd by hand?
(In reply to Miroslav Grepl from comment #2) > The question is how it got the bad labeling. Have you ever started the sshd > by hand? Yes, I am start sshd by hand for debugging purpose for get log for issue https://bugzilla.redhat.com/show_bug.cgi?id=1151148
I guess we could add a file name transition for the pid file, but that would seem to be just bloating policy.
I believe we should stay without the transition for the pid file and make it working using runcon for example.