Bug 916686 - SELinux is preventing /usr/bin/gawk from 'ioctl' accesses on the file /proc/sys/fs/file-nr.
Summary: SELinux is preventing /usr/bin/gawk from 'ioctl' accesses on the file /proc/s...
Keywords:
Status: CLOSED DUPLICATE of bug 916712
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: i686
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:df42c7708f7905c72d3924920c6...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-28 16:35 UTC by Jeff Buhrt
Modified: 2013-03-04 09:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-04 09:15:18 UTC
Type: ---


Attachments (Terms of Use)

Description Jeff Buhrt 2013-02-28 16:35:24 UTC
Description of problem:
[selinux read policy for munin plugin wrong in F18]

With "setenforce 1"  you will see the errors below in /var/log/munin/munin-node.log when you run:
$ telnet localhost 4949
fetch open_files

2013/02/28-11:18:43 CONNECT TCP Peer: "[127.0.0.1]:45213" Local: "[127.0.0.1]:4949"
Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Net/Server.pm line 600.
2013/02/28-11:18:44 [28928] Error output from open_files:
2013/02/28-11:18:44 [28928]     /etc/munin/plugins/open_files: line 60: /proc/sys/fs/file-nr: Permission denied
2013/02/28-11:18:44 [28928] Service 'open_files' exited with status 1/0.
2013/02/28-11:19:20 [28928] Error output from open_files:
2013/02/28-11:19:20 [28928]     /etc/munin/plugins/open_files: line 60: /proc/sys/fs/file-nr: Permission denied
2013/02/28-11:19:20 [28928] Service 'open_files' exited with status 1/0.

To repeat install and enable munin-node:
# systemctl restart munin-node.service
Next just:
$ telnet localhost 4949
fetch open_files

to get the details below of the error: setenforce permissive

Feb 28 11:25:18 xx setroubleshoot: SELinux is preventing /usr/bin/bash from read access on the file file-nr. For complete SELinux messages. run sealert -l e95041de-a80f-4aff-b5e7-6321545df7c8
Feb 28 11:25:18 xx setroubleshoot: SELinux is preventing /usr/bin/bash from read access on the file file-nr. For complete SELinux messages. run sealert -l e95041de-a80f-4aff-b5e7-6321545df7c8
Feb 28 11:25:19 xx setroubleshoot: SELinux is preventing /usr/bin/gawk from getattr access on the file /proc/sys/fs/file-nr. For complete SELinux messages. run sealert -l 6ee275f6-fb4e-4c4d-8833-70deb8e6802d
Feb 28 11:25:19 xx setroubleshoot: SELinux is preventing /usr/bin/gawk from ioctl access on the file /proc/sys/fs/file-nr. For complete SELinux messages. run sealert -l d2d5036e-2d98-44fd-bb08-14f5eec0f430
SELinux is preventing /usr/bin/gawk from 'ioctl' accesses on the file /proc/sys/fs/file-nr.

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

If you believe that gawk should be allowed ioctl access on the file-nr 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 awk /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:system_munin_plugin_t:s0
Target Context                system_u:object_r:sysctl_fs_t:s0
Target Objects                /proc/sys/fs/file-nr [ file ]
Source                        awk
Source Path                   /usr/bin/gawk
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           gawk-4.0.1-2.fc18.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-81.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.7.9-201.fc18.i686.PAE #1 SMP Mon
                              Feb 18 21:21:43 UTC 2013 i686 i686
Alert Count                   3
First Seen                    2013-02-28 11:19:55 EST
Last Seen                     2013-02-28 11:25:18 EST
Local ID                      d2d5036e-2d98-44fd-bb08-14f5eec0f430

Raw Audit Messages
type=AVC msg=audit(1362068718.671:2548): avc:  denied  { ioctl } for  pid=29867 comm="awk" path="/proc/sys/fs/file-nr" dev="proc" ino=38932 scontext=system_u:system_r:system_munin_plugin_t:s0 tcontext=system_u:object_r:sysctl_fs_t:s0 tclass=file


type=SYSCALL msg=audit(1362068718.671:2548): arch=i386 syscall=ioctl success=no exit=ENOTTY a0=0 a1=5401 a2=bf916ba8 a3=bf916bf4 items=0 ppid=29866 pid=29867 auid=4294967295 uid=99 gid=99 euid=99 suid=99 fsuid=99 egid=99 sgid=99 fsgid=99 ses=4294967295 tty=(none) comm=awk exe=/usr/bin/gawk subj=system_u:system_r:system_munin_plugin_t:s0 key=(null)

Hash: awk,system_munin_plugin_t,sysctl_fs_t,file,ioctl

audit2allow

#============= system_munin_plugin_t ==============
allow system_munin_plugin_t sysctl_fs_t:file ioctl;

audit2allow -R

#============= system_munin_plugin_t ==============
allow system_munin_plugin_t sysctl_fs_t:file ioctl;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.9-201.fc18.i686.PAE
type:           libreport

Comment 1 Jeff Buhrt 2013-02-28 18:17:23 UTC
occurs at the same time and is related to: https://bugzilla.redhat.com/show_bug.cgi?id=916712

Comment 2 Miroslav Grepl 2013-03-04 09:15:18 UTC

*** This bug has been marked as a duplicate of bug 916712 ***


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