Bug 1151157 - SELinux is preventing sshd from 'getattr' accesses on the file /run/sshd.pid.
Summary: SELinux is preventing sshd from 'getattr' accesses on the file /run/sshd.pid.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 21
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:e4a235bc4016930686ffff49451...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-09 16:40 UTC by Mikhail
Modified: 2014-10-13 08:46 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-10-10 06:35:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mikhail 2014-10-09 16:40:46 UTC
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

Comment 1 Lukas Vrabec 2014-10-10 06:35:13 UTC
*****  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

Comment 2 Miroslav Grepl 2014-10-10 07:49:16 UTC
The question is how it got the bad labeling. Have you ever started the sshd by hand?

Comment 3 Mikhail 2014-10-10 10:45:51 UTC
(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

Comment 4 Daniel Walsh 2014-10-12 11:40:40 UTC
I guess we could add a file name transition for the pid file, but that would seem to be just bloating policy.

Comment 5 Miroslav Grepl 2014-10-13 08:46:53 UTC
I believe we should stay without the transition for the pid file and make it working using runcon for example.


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