Bug 730442 - SELinux is preventing /sbin/dhclient from 'open' accesses on the file nm-dhclient-wlan0.conf.
Summary: SELinux is preventing /sbin/dhclient from 'open' accesses on the file nm-dhcl...
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
Whiteboard: setroubleshoot_trace_hash:6347fefaf88...
Depends On:
TreeView+ depends on / blocked
Reported: 2011-08-12 23:13 UTC by vxator
Modified: 2011-11-14 13:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-11-14 13:00:01 UTC

Attachments (Terms of Use)

Description vxator 2011-08-12 23:13:15 UTC
SELinux is preventing /sbin/dhclient from 'open' accesses on the file nm-dhclient-wlan0.conf.

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

If you believe that dhclient should be allowed open access on the nm-dhclient-wlan0.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 dhclient /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:system_r:dhcpc_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:var_run_t:s0
Target Objects                nm-dhclient-wlan0.conf [ file ]
Source                        dhclient
Source Path                   /sbin/dhclient
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           dhclient-4.2.1-9.P1.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-35.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.40-4.fc15.x86_64 #1
                              SMP Fri Jul 29 18:46:53 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Fri 12 Aug 2011 05:35:19 PM CLT
Last Seen                     Fri 12 Aug 2011 05:35:19 PM CLT
Local ID                      44b2340c-c72f-4840-92cb-9bc8add37259

Raw Audit Messages
type=AVC msg=audit(1313184919.598:682): avc:  denied  { open } for  pid=16327 comm="dhclient" name="nm-dhclient-wlan0.conf" dev=tmpfs ino=2928294 scontext=unconfined_u:system_r:dhcpc_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file

type=SYSCALL msg=audit(1313184919.598:682): arch=x86_64 syscall=open success=no exit=EACCES a0=7fff382e7902 a1=80000 a2=7f916e498760 a3=1 items=0 ppid=3765 pid=16327 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=2 comm=dhclient exe=/sbin/dhclient subj=unconfined_u:system_r:dhcpc_t:s0-s0:c0.c1023 key=(null)

Hash: dhclient,dhcpc_t,var_run_t,file,open


#============= dhcpc_t ==============
allow dhcpc_t var_run_t:file open;

audit2allow -R

#============= dhcpc_t ==============
allow dhcpc_t var_run_t:file open;

Comment 1 Daniel Walsh 2011-08-15 11:12:17 UTC
restorecon -R -v /var/run

Should fix.  

How are you bringing your network up?

Comment 2 Rory Renton 2011-11-11 22:11:34 UTC
I have this on FC15 x86_64 (with all updates).

I tried "restorecon -R -v /var/run"

it does not work.

if you run it, then run it again it doesn't display anything the second time (showing it worked). but if I run NetworkManager (as SU) then it comes up with a SElinux problem (this one again). then if I do the 'fix' again, same happens (first time has output, then none).

so Network (ran as SU) is messing it up?

Comment 3 Miroslav Grepl 2011-11-14 13:00:01 UTC
You should run NetworkManager using a service script

# service NetworkManager start

otherwise you run NetworkManager as unconfined_t domain which causes this mislabeling.

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