Bug 195838

Summary: selinux-policy-targeted stops wpa_supplicant from reading certificates
Product: [Fedora] Fedora Reporter: James <james>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-06-22 00:56:35 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 James 2006-06-18 14:48:54 UTC
Description of problem:
selinux-policy-targeted seems to prevent wpa_supplicant from accessing SSL
certificate files from somewhere in /etc/pki or in a user's $HOME. This prevents
association with EAP-TLS. See the log excerpt below.

Version-Release number of selected component (if applicable):
NetworkManager-0.6.2-2.fc5
selinux-policy-targeted-2.2.43-4.fc5
wpa_supplicant-0.4.8-10.fc5

How reproducible:
Always.

Steps to Reproduce:
1. Set SELinux enforcing.
2. [Re]Start NetworkManager.
3. Attempt to associate.
  
Actual results:
From the logs:

Jun 18 15:29:13 harmony kernel: audit(1150640953.494:107): avc:  denied  {
search } for  pid=4741 comm="wpa_supplicant" name="home" dev=dm-0 ino=4611265
scontext=user_u:system_r:NetworkManager_t:s0
tcontext=system_u:object_r:home_root_t:s0 tclass=dir
Jun 18 15:29:13 harmony kernel: audit(1150640953.494:108): avc:  denied  {
search } for  pid=4741 comm="wpa_supplicant" name="home" dev=dm-0 ino=4611265
scontext=user_u:system_r:NetworkManager_t:s0
tcontext=system_u:object_r:home_root_t:s0 tclass=dir

Expected results:
wpa_supplicant is allowed to read the certificates.

Comment 1 James 2006-06-18 14:50:48 UTC
I forgot to add that I see this when wpa_supplicant is launched by
NetworkManager, and NetworkManager is started as a service via the /etc/init.d
mechanism. If I run /usr/sbin/NetworkManager --no-daemon (with SELinux enforcing
enabled), everything works fine.

Comment 2 Daniel Walsh 2006-06-18 15:56:27 UTC
This indicates that wpa-supplicant is trying to read the homedirectory?

IE It is being denied a search of /home 

Comment 3 James 2006-06-18 16:03:42 UTC
The certificates are in $HOME/pki/. I get something similar if I put them
"system-wide", e.g. in /etc/pki/wireless/; in that case, name="home" is replaced
with name="pki". Since each user may configure different certificates with
nm-applet, I would think that wpa_supplicant should be able to read these areas.


Comment 4 Daniel Walsh 2006-06-19 14:21:29 UTC
You mean cert correct?  If you put them in /etc/pki/wireless, they should be
labeled cert_t and I will change NetworkManager policy to be able to read cert_t
files,

You can do this yourself by executing the following.
put the cert files in /etc/pki/wireless

restorecon -R -v /etc/pki

Run network manager to generate avc messages

grep cert_t /var/log/message | audit2allow -M wpa

semodule -i wpa.pp

This should update the policy to allow NetworkManager to read certificate files.


Comment 5 James 2006-06-19 17:32:26 UTC
Thanks, that worked.