Bug 1225245 - SELinux is preventing hostapd from using the 'net_admin' capabilities.
Summary: SELinux is preventing hostapd from using the 'net_admin' capabilities.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 22
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:90bc046ad31beda546d35c9e712...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-26 23:40 UTC by nioroso_x3
Modified: 2019-08-09 10:41 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.13.1-128.1.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1237343 (view as bug list)
Environment:
Last Closed: 2015-06-11 18:37:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
log file (2.59 KB, text/plain)
2015-05-31 15:10 UTC, rvcsaba
no flags Details
avc: denied { net_raw } for pid=1793 comm="hostapd" (2.22 KB, application/octet-stream)
2015-06-10 12:36 UTC, rvcsaba
no flags Details

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.


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