Bug 1225245

Summary: SELinux is preventing hostapd from using the 'net_admin' capabilities.
Product: [Fedora] Fedora Reporter: nioroso_x3
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba, rvcsaba, thomas
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:90bc046ad31beda546d35c9e7128f07157372f0ea03fc12058199387d95ea262
Fixed In Version: selinux-policy-3.13.1-128.1.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1237343 (view as bug list) Environment:
Last Closed: 2015-06-11 18:37:56 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:
Attachments:
Description Flags
log file
none
avc: denied { net_raw } for pid=1793 comm="hostapd" none

Description nioroso_x3 2015-05-26 23:40:36 UTC
Description of problem:
Installed hostapd, modified systemctl file to allow 2 config files for two wlan cards.
Systemd doesnt let hostapd run, but it runs fine if I run it as root manually.
SELinux is preventing hostapd from using the 'net_admin' capabilities.

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

If you believe that hostapd should have the net_admin capability 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 hostapd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:hostapd_t:s0
Target Context                system_u:system_r:hostapd_t:s0
Target Objects                Unknown [ capability ]
Source                        hostapd
Source Path                   hostapd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-126.fc22.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.0.4-301.fc22.x86_64 #1 SMP Thu
                              May 21 13:10:33 UTC 2015 x86_64 x86_64
Alert Count                   34
First Seen                    2015-05-22 14:14:55 CLST
Last Seen                     2015-05-26 20:35:43 CLST
Local ID                      6b6d59eb-4524-4c87-8a9b-6a22b23adeb8

Raw Audit Messages
type=AVC msg=audit(1432683343.787:1097): avc:  denied  { net_admin } for  pid=6551 comm="hostapd" capability=12  scontext=system_u:system_r:hostapd_t:s0 tcontext=system_u:system_r:hostapd_t:s0 tclass=capability permissive=0


Hash: hostapd,hostapd_t,hostapd_t,capability,net_admin

Version-Release number of selected component:
selinux-policy-3.13.1-126.fc22.noarch

Additional info:
reporter:       libreport-2.5.1
hashmarkername: setroubleshoot
kernel:         4.0.4-301.fc22.x86_64
type:           libreport

Comment 1 rvcsaba 2015-05-31 15:10:21 UTC
Created attachment 1032880 [details]
log file

Exactly same problem here.

Comment 2 Thomas Köller 2015-05-31 19:54:34 UTC
Description of problem:
Started hostapd via systemd

Version-Release number of selected component:
selinux-policy-3.13.1-126.fc22.noarch

Additional info:
reporter:       libreport-2.5.1
hashmarkername: setroubleshoot
kernel:         4.0.4-301.fc22.x86_64
type:           libreport

Comment 3 Miroslav Grepl 2015-06-01 13:17:31 UTC
commit c6d5db8082b8f27471dad06176b0f05a7d7cfa01
Author: Miroslav Grepl <mgrepl>
Date:   Mon Jun 1 15:15:46 2015 +0200

    Allow hostapd net_admin capability. hostapd needs to able to set an interface flag. BZ(1032880)

Comment 4 Fedora Update System 2015-06-09 14:39:26 UTC
selinux-policy-3.13.1-128.1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/selinux-policy-3.13.1-128.1.fc22

Comment 5 rvcsaba 2015-06-10 12:36:55 UTC
Created attachment 1037264 [details]
avc:  denied  { net_raw } for  pid=1793 comm="hostapd"

Partially solved this problem, not at all.

selinux-policy-3.13.1-128.1.fc22.noarch
hostapd-2.4-2.fc22.i686

Comment 6 Fedora Update System 2015-06-10 19:11:12 UTC
Package selinux-policy-3.13.1-128.1.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.13.1-128.1.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-9714/selinux-policy-3.13.1-128.1.fc22
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2015-06-11 18:37:56 UTC
selinux-policy-3.13.1-128.1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.