Bug 1304072 - SELinux is preventing /usr/sbin/nmbd from using the 'net_admin' capabilities.
SELinux is preventing /usr/sbin/nmbd from using the 'net_admin' capabilities.
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: samba (Show other bugs)
24
x86_64 Unspecified
medium Severity medium
: ---
: ---
Assigned To: Guenther Deschner
Fedora Extras Quality Assurance
abrt_hash:354974a907a8b45b4f3ab199210...
:
: 1341722 1386933 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-02 14:36 EST by Laine Stump
Modified: 2016-12-05 04:38 EST (History)
31 users (show)

See Also:
Fixed In Version: selinux-policy-3.13.1-191.21.fc24
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-05 04:38:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Laine Stump 2016-02-02 14:36:28 EST
Description of problem:
rebooted after dnf update of a ton of packages. I have nmbd configured to run on my system, but no special config for it.
SELinux is preventing /usr/sbin/nmbd from using the 'net_admin' capabilities.

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

If you believe that nmbd 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 nmbd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:nmbd_t:s0
Target Context                system_u:system_r:nmbd_t:s0
Target Objects                Unknown [ capability ]
Source                        nmbd
Source Path                   /usr/sbin/nmbd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           samba-4.3.4-1.fc23.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-158.2.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.5.0-rc2 #20 SMP Mon Feb 1
                              17:47:36 EST 2016 x86_64 x86_64
Alert Count                   17
First Seen                    2015-12-19 21:02:27 EST
Last Seen                     2016-02-02 14:32:13 EST
Local ID                      24b444da-921b-4967-91bb-214052ca27ea

Raw Audit Messages
type=AVC msg=audit(1454441533.869:758): avc:  denied  { net_admin } for  pid=3343 comm="nmbd" capability=12  scontext=system_u:system_r:nmbd_t:s0 tcontext=system_u:system_r:nmbd_t:s0 tclass=capability permissive=1


type=SYSCALL msg=audit(1454441533.869:758): arch=x86_64 syscall=recvmsg success=yes exit=3560 a0=25 a1=7ffec9443ca0 a2=0 a3=7f4789e3c2d8 items=0 ppid=1 pid=3343 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=nmbd exe=/usr/sbin/nmbd subj=system_u:system_r:nmbd_t:s0 key=(null)

Hash: nmbd,nmbd_t,nmbd_t,capability,net_admin

Version-Release number of selected component:
selinux-policy-3.13.1-158.2.fc23.noarch

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.5.0-rc2
type:           libreport
Comment 1 Lukas Vrabec 2016-06-02 06:26:07 EDT
*** Bug 1341722 has been marked as a duplicate of this bug. ***
Comment 2 Lukas Vrabec 2016-06-02 06:34:08 EDT
Samba folks, 

Do we need allow net_admin capability for nmbd?

 
CAP_NET_ADMIN
              Perform various network-related operations:
              * interface configuration;
              * administration of IP firewall, masquerading, and accounting;
              * modify routing tables;
              * bind to any address for transparent proxying;
              * set type-of-service (TOS)
              * clear driver statistics;
              * set promiscuous mode;
              * enabling multicasting;
              * use  setsockopt(2) to set the following socket options: SO_DEBUG, SO_MARK, SO_PRIORITY (for a pri‐
                ority outside the range 0 to 6), SO_RCVBUFFORCE, and SO_SNDBUFFORCE.

Thank you.
Comment 3 Michael Hampton 2016-07-30 00:41:17 EDT
Description of problem:
Started nmb.service

Version-Release number of selected component:
selinux-policy-3.13.1-191.5.fc24.noarch

Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.6.4-301.fc24.x86_64
type:           libreport
Comment 4 dan 2016-08-10 16:35:50 EDT
Also seeing this after upgrade from FC23 to FC24.

SELinux is preventing nmbd from using the net_admin capability.

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

If you believe that nmbd 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:
# ausearch -c 'nmbd' --raw | audit2allow -M my-nmbd
# semodule -X 300 -i my-nmbd.pp

Additional Information:
Source Context                system_u:system_r:nmbd_t:s0
Target Context                system_u:system_r:nmbd_t:s0
Target Objects                Unknown [ capability ]
Source                        nmbd
Source Path                   nmbd
Port                          <Unknown>
Host                          zzzz.private
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-191.8.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     ears.private
Platform                      Linux zzzz.private 4.6.4-301.fc24.x86_64 #1 SMP
                              Tue Jul 12 11:50:00 UTC 2016 x86_64 x86_64
Alert Count                   2
First Seen                    2016-08-10 16:31:59 EDT
Last Seen                     2016-08-10 16:31:59 EDT
Local ID                      4d9b6d02-2521-40c1-a682-414fa707a947

Raw Audit Messages
type=AVC msg=audit(1470861119.219:59792): avc:  denied  { net_admin } for  pid=20381 comm="nmbd" capability=12  scontext=system_u:system_r:nmbd_t:s0 tcontext=system_u:system_r:nmbd_t:s0 tclass=capability permissive=0


Hash: nmbd,nmbd_t,nmbd_t,capability,net_admin
Comment 5 Lukas Vrabec 2016-08-11 06:58:52 EDT
Could anybody answer comment#2? 

Thank you.
Comment 6 Cao Chi Tam 2016-08-22 06:43:59 EDT
To fix this bug, you can run recommended commands below "Do
allow this access for now by executing:"
It's work for me, and you?
Comment 7 dan 2016-08-22 11:36:14 EDT
Agree with Lukas in comment #5, someone from the Samba team should respond to comment #2.
Comment 8 Alexander Bokovoy 2016-08-22 11:57:48 EDT
I tried to find out what it could be, but nmbd is using generic Samba routines for opening sockets so the same policy that applies to smbd would need to apply to nmbd.
Comment 9 Terry A. Hurlbut 2016-09-03 09:33:04 EDT
Description of problem:
An attempt to access Samba shares on Dolphin produced this error.


Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.7.2-201.fc24.x86_64
type:           libreport
Comment 10 Shaun Assam 2016-10-21 16:09:53 EDT
Description of problem:
- Installed samba package via CLI.
- Entered command: systemctl start nmb.service smb.service.

Version-Release number of selected component:
selinux-policy-3.13.1-191.18.fc24.noarch

Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.7.9-200.fc24.x86_64
type:           libreport
Comment 11 Lukas Vrabec 2016-11-07 16:37:53 EST
*** Bug 1386933 has been marked as a duplicate of this bug. ***
Comment 12 secondary 2016-11-14 13:41:13 EST
I think this capability is necessary. Without which nmbd fails to respond to broadcast queries. That is, everything but network browsing works.
Comment 13 Fedora End Of Life 2016-11-24 10:21:26 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 14 dan 2016-11-25 12:55:20 EST
Version in bug report should be bumped to at least FC24 as this but occurs there.
Comment 15 Laine Stump 2016-11-30 10:58:33 EST
Lukas - you changed the status of this to POST, but didn't include any information about where the fix was posted to. Is it fixed in a particular upstream version of the package? What about F24/25/rawhide - do they have a new enough version of the package (is it samba that's been / will be modified?)

In the meantime, I'm moving to F24 at Dan's request.
Comment 16 Lukas Vrabec 2016-12-05 04:38:06 EST
Hi Laine, 

$ rpm -q selinux-policy 
selinux-policy-3.13.1-191.21.fc24.noarch

$ sesearch -A -s nmbd_t -t nmbd_t -c capability -p net_admin
Found 1 semantic av rules:
   allow nmbd_t nmbd_t : capability { net_bind_service net_admin } ;

Issue is fixed in current stable release.

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