Bug 730482 - SELinux is preventing ntpd from 'read' accesses on the file /etc/resolv.conf.
Summary: SELinux is preventing ntpd from 'read' accesses on the file /etc/resolv.conf.
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 15
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
Whiteboard: setroubleshoot_trace_hash:ee444144ee8...
: 730483 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2011-08-13 15:10 UTC by Heiko Adams
Modified: 2011-11-02 17:06 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-10-07 14:57:44 UTC
Type: ---

Attachments (Terms of Use)

Description Heiko Adams 2011-08-13 15:10:42 UTC
SELinux is preventing ntpd from 'read' accesses on the file /etc/resolv.conf.

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

If you want to fix the label. 
/etc/resolv.conf default label should be net_conf_t.
Then you can run restorecon.
# /sbin/restorecon -v /etc/resolv.conf

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

If you believe that ntpd should be allowed read access on the resolv.conf file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# grep ntpd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:ntpd_t:s0
Target Context                system_u:object_r:NetworkManager_var_lib_t:s0
Target Objects                /etc/resolv.conf [ file ]
Source                        ntpd
Source Path                   ntpd
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-38.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) #1 SMP
                              Sat Aug 6 06:02:30 UTC 2011 i686 i686
Alert Count                   3
First Seen                    Sa 13 Aug 2011 17:06:37 CEST
Last Seen                     Sa 13 Aug 2011 17:08:41 CEST
Local ID                      2d5e3247-fb0d-4e0a-82bd-a25db6467d81

Raw Audit Messages
type=AVC msg=audit(1313248121.634:68): avc:  denied  { read } for  pid=828 comm="ntpd" name="resolv.conf" dev=dm-1 ino=1838139 scontext=system_u:system_r:ntpd_t:s0 tcontext=system_u:object_r:NetworkManager_var_lib_t:s0 tclass=file

Hash: ntpd,ntpd_t,NetworkManager_var_lib_t,file,read


#============= ntpd_t ==============
allow ntpd_t NetworkManager_var_lib_t:file read;

audit2allow -R

#============= ntpd_t ==============
allow ntpd_t NetworkManager_var_lib_t:file read;

Comment 1 Daniel Walsh 2011-08-15 10:42:14 UTC
*** Bug 730483 has been marked as a duplicate of this bug. ***

Comment 2 Daniel Walsh 2011-08-15 10:43:22 UTC
Somewhere in the NetworkManager stack, it is creating a new resolv.conf and then mv'ing it to /etc directory.

It should be executing a restorecon on the file after the move.

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