Bug 806880

Summary: SELinux is preventing /usr/bin/smbspool from 'search' accesses on the directory nmbd.
Product: [Fedora] Fedora Reporter: gasdim <kostas.linux>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dominick.grift, dwalsh, jpopelka, mgrepl, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:b80e14ea38239339e6952540123ef39110f11bb3e2eaa376c6b53f654b52a23e
Fixed In Version: selinux-policy-3.10.0-84.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-22 03:37:45 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 gasdim 2012-03-26 12:29:06 UTC
libreport version: 2.0.8
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.3.0-4.fc16.x86_64
reason:         SELinux is preventing /usr/bin/smbspool from 'search' accesses on the directory nmbd.
time:           Δευ 26 Μάρ 2012 03:28:08 μμ EEST

description:
:SELinux is preventing /usr/bin/smbspool from 'search' accesses on the directory nmbd.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that smbspool should be allowed search access on the nmbd 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 smb /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:cupsd_t:s0-s0:c0.c1023
:Target Context                system_u:object_r:nmbd_var_run_t:s0
:Target Objects                nmbd [ dir ]
:Source                        smb
:Source Path                   /usr/bin/smbspool
:Port                          <Άγνωστο>
:Host                          (removed)
:Source RPM Packages           samba-client-3.6.3-78.fc16.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-80.fc16.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.3.0-4.fc16.x86_64 #1
:                              SMP Tue Mar 20 18:05:40 UTC 2012 x86_64 x86_64
:Alert Count                   3
:First Seen                    Δευ 26 Μάρ 2012 03:23:12 μμ EEST
:Last Seen                     Δευ 26 Μάρ 2012 03:23:28 μμ EEST
:Local ID                      087a0b0f-63a0-464b-aafb-3dd20227f979
:
:Raw Audit Messages
:type=AVC msg=audit(1332764608.249:122): avc:  denied  { search } for  pid=7041 comm="smb" name="nmbd" dev="tmpfs" ino=19578 scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:nmbd_var_run_t:s0 tclass=dir
:
:
:type=SYSCALL msg=audit(1332764608.249:122): arch=x86_64 syscall=connect success=no exit=EACCES a0=c a1=7fe8163cef28 a2=6e a3=0 items=0 ppid=1042 pid=7041 auid=4294967295 uid=4 gid=7 euid=4 suid=4 fsuid=4 egid=7 sgid=7 fsgid=7 tty=(none) ses=4294967295 comm=smb exe=/usr/bin/smbspool subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 key=(null)
:
:Hash: smb,cupsd_t,nmbd_var_run_t,dir,search
:
:audit2allow
:
:#============= cupsd_t ==============
:allow cupsd_t nmbd_var_run_t:dir search;
:
:audit2allow -R
:
:#============= cupsd_t ==============
:allow cupsd_t nmbd_var_run_t:dir search;
:

Comment 1 Miroslav Grepl 2012-03-26 14:24:25 UTC
Does it relate with fact that cups execs smbtool?

NAME
       smbspool - send a print file to an SMB printer

Does it need to read pid file?

Comment 2 Tim Waugh 2012-03-26 15:00:34 UTC
This is due to the smb backend being used, and this is a symlink to /usr/bin/smbspool, yes.

I don't know why/whether smbspool needs to read /var/run/nmbd.

Comment 3 Tim Waugh 2012-03-26 15:33:06 UTC
Looks like reading the nmbd PID is part of libsmb, so this is expected.

Comment 4 Miroslav Grepl 2012-03-27 06:04:20 UTC
gasdim,
could you execute

$ semanage permissive -a cupsd_t 

re-test it and see if you get more AVC msgs

$ ausearch -m avc -ts recent

$ semanage permissive -d cupsd_t

Comment 5 gasdim 2012-03-27 11:27:33 UTC
(In reply to comment #4)
> gasdim,
> could you execute

$ semanage permissive -a cupsd_t 
 
 I checked this. No message. All fine.

$ ausearch -m avc -ts recent

 I checked this. The reply no matches.

$ semanage permissive -d cupsd_t

 I checked this. No message. All fine

Thanks for the reply!

Comment 6 Miroslav Grepl 2012-03-27 17:29:58 UTC
Fixed in selinux-policy-3.10.0-82.fc16

Comment 7 Fedora Update System 2012-04-18 12:55:30 UTC
selinux-policy-3.10.0-84.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-84.fc16

Comment 8 Fedora Update System 2012-04-22 03:37:45 UTC
selinux-policy-3.10.0-84.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.