Bug 916036 - SELinux is preventing /usr/sbin/nmbd from 'create' accesses on the directory samba.
Summary: SELinux is preventing /usr/sbin/nmbd from 'create' accesses on the directory ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:c728145fdeebba36e865a72d26a...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-27 04:37 UTC by David Dreggors
Modified: 2013-03-03 22:43 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-03-03 22:43:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description David Dreggors 2013-02-27 04:37:44 UTC
Description of problem:
I started smb/nmb services.

Also here is the outout of audit2why:

# grep nmbd /var/log/audit/audit.log | audit2why
type=AVC msg=audit(1361934929.541:1728): avc:  denied  { create } for  pid=4149 comm="nmbd" name="samba" scontext=system_u:system_r:nmbd_t:s0 tcontext=system_u:object_r:samba_var_t:s0 tclass=dir

        Was caused by:
                Missing type enforcement (TE) allow rule.

                You can use audit2allow to generate a loadable module to allow this access.

SELinux is preventing /usr/sbin/nmbd from 'create' accesses on the directory samba.

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

If you believe that nmbd should be allowed create access on the samba directory 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:object_r:samba_var_t:s0
Target Objects                samba [ dir ]
Source                        nmbd
Source Path                   /usr/sbin/nmbd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           samba-4.0.3-2.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-81.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.7.9-201.fc18.x86_64 #1 SMP Mon
                              Feb 18 21:07:56 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-02-26 22:15:29 EST
Last Seen                     2013-02-26 22:15:29 EST
Local ID                      8573b7cb-c0c8-46a2-b922-1954f8424a6c

Raw Audit Messages
type=AVC msg=audit(1361934929.541:1728): avc:  denied  { create } for  pid=4149 comm="nmbd" name="samba" scontext=system_u:system_r:nmbd_t:s0 tcontext=system_u:object_r:samba_var_t:s0 tclass=dir


type=SYSCALL msg=audit(1361934929.541:1728): arch=x86_64 syscall=mkdir success=yes exit=0 a0=19ca8b0 a1=1ed a2=0 a3=71 items=0 ppid=1 pid=4149 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=nmbd exe=/usr/sbin/nmbd subj=system_u:system_r:nmbd_t:s0 key=(null)

Hash: nmbd,nmbd_t,samba_var_t,dir,create

audit2allow

#============= nmbd_t ==============
allow nmbd_t samba_var_t:dir create;

audit2allow -R

#============= nmbd_t ==============
allow nmbd_t samba_var_t:dir create;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.9-201.fc18.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-02-27 15:10:16 UTC
0d241b3d6c8d9ecbcbe2658e8de4c28e661be5b7 fixes this in Rawhide.

Comment 2 Miroslav Grepl 2013-02-28 14:02:18 UTC
Backported.

commit 8a1781ea56555eb5cbdb0dc3f82bc225f15ef181
Author: Dan Walsh <dwalsh>
Date:   Wed Feb 27 10:09:53 2013 -0500

    Allow nmbd_t to create samba_var_t directories

Comment 3 Fedora Update System 2013-03-01 13:06:32 UTC
selinux-policy-3.11.1-82.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-82.fc18

Comment 4 David Dreggors 2013-03-01 20:48:46 UTC
[root@loki ~ ]# rpm -q selinux-policy
selinux-policy-3.11.1-81.fc18.noarch

[root@loki ~ ]# yum update selinux-policy --enablerepo=updates-testing
Loaded plugins: langpacks, presto, refresh-packagekit
No Packages marked for Update


Where is it? 
How can I install to test?

Comment 5 David Dreggors 2013-03-02 02:19:11 UTC
Never mind, I installed and confirmed that it works.
Karma added ;-)

Comment 6 Fedora Update System 2013-03-02 20:16:18 UTC
Package selinux-policy-3.11.1-82.fc18:
* should fix your issue,
* was pushed to the Fedora 18 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.11.1-82.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-3309/selinux-policy-3.11.1-82.fc18
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-03-03 22:43:26 UTC
selinux-policy-3.11.1-82.fc18 has been pushed to the Fedora 18 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.