Bug 1024468

Summary: SELinux is preventing /usr/bin/df from 'getattr' accesses on the directory /sys/kernel/config.
Product: [Fedora] Fedora Reporter: Christopher Rose <crose>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: crose, dominick.grift, dwalsh, lvrabec, mgrepl, tino.wolf.1980
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:4ab384ba04e9dcbb4803dae7d8a0b7ae49cd79457925c1791f3cab2c088e2689
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-18 11:38:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christopher Rose 2013-10-29 17:40:48 UTC
Description of problem:
started httpd
SELinux is preventing /usr/bin/df from 'getattr' accesses on the directory /sys/kernel/config.

*****  Plugin restorecon (99.5 confidence) suggests  *************************

If you want to fix the label. 
/sys/kernel/config default label should be sysfs_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /sys/kernel/config

*****  Plugin catchall (1.49 confidence) suggests  ***************************

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

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:configfs_t:s0
Target Objects                /sys/kernel/config [ dir ]
Source                        df
Source Path                   /usr/bin/df
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           coreutils-8.21-11.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-74.10.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.11.6-200.fc19.x86_64 #1 SMP Fri
                              Oct 18 22:34:18 UTC 2013 x86_64 x86_64
Alert Count                   7
First Seen                    2013-10-29 13:38:19 EDT
Last Seen                     2013-10-29 13:38:19 EDT
Local ID                      302eeeb2-85cf-4c23-934e-194a29ebff99

Raw Audit Messages
type=AVC msg=audit(1383068299.479:672): avc:  denied  { getattr } for  pid=6924 comm="df" path="/sys/kernel/config" dev="configfs" ino=10226 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:configfs_t:s0 tclass=dir


type=SYSCALL msg=audit(1383068299.479:672): arch=x86_64 syscall=stat success=no exit=EACCES a0=1245250 a1=7fff4f7625d0 a2=7fff4f7625d0 a3=ffffffff items=0 ppid=6923 pid=6924 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 ses=4294967295 tty=(none) comm=df exe=/usr/bin/df subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: df,httpd_t,configfs_t,dir,getattr

Additional info:
reporter:       libreport-2.1.8
hashmarkername: setroubleshoot
kernel:         3.11.6-200.fc19.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2014-01-27 17:46:03 UTC
Do you have a CGI script?

Comment 2 Christopher Rose 2014-06-09 13:12:11 UTC
Not that I'm aware of.

Comment 3 Miroslav Grepl 2014-06-09 13:25:37 UTC
Are you still getting it?

Comment 4 Daniel Walsh 2014-06-10 13:05:52 UTC
We should allow httpd to getattr on all fs.

Comment 5 Fedora End Of Life 2015-01-09 20:24:03 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Fedora End Of Life 2015-02-18 11:38:48 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Woti 2020-01-23 09:11:32 UTC
I got the same message on Fedora 31 Server Edition fresh install.

SELinux is preventing /usr/bin/df from 'getattr' accesses on the directory /sys/kernel/config.

type=AVC msg=audit(1579728866.877:286): avc: denied { getattr } for pid=7112 comm="df" path="/sys/kernel/config" dev="configfs" ino=266 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:configfs_t:s0 tclass=dir permissive=0 

allow this access for now by executing:
# ausearch -c 'df' --raw | audit2allow -M my-df # semodule -X 300 -i my-df.pp

Any advice?

Best regards,
Woti