Bug 599035 - SELinux is preventing Samba (/usr/sbin/smbd) "read" access to /lost+found.
Summary: SELinux is preventing Samba (/usr/sbin/smbd) "read" access to /lost+found.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 13
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:b7147439d20...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-02 14:54 UTC by Iyengar
Modified: 2010-06-07 14:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-07 14:14:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Iyengar 2010-06-02 14:54:39 UTC
Summary:

SELinux is preventing Samba (/usr/sbin/smbd) "read" access to /lost+found.

Detailed Description:

[SELinux is in permissive mode. This access was not denied.]

SELinux denied samba access to /lost+found. If you want to share this directory
with samba it has to have a file context label of samba_share_t. If you did not
intend to use /lost+found as a samba repository it could indicate either a bug
or it could signal a intrusion attempt. Please refer to 'man samba_selinux' for
more information on setting up Samba and SELinux.

Allowing Access:

You can alter the file context by executing chcon -R -t samba_share_t
'/lost+found' You must also change the default file context files on the system
in order to preserve them even on a full relabel. "semanage fcontext -a -t
samba_share_t '/lost+found'"

Fix Command:

chcon -R -t samba_share_t '/lost+found'

Additional Information:

Source Context                system_u:system_r:smbd_t:s0
Target Context                system_u:object_r:lost_found_t:s0
Target Objects                /lost+found [ dir ]
Source                        smbd
Source Path                   /usr/sbin/smbd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           samba-3.5.3-61.fc13
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-15.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Plugin Name                   samba_share
Host Name                     (removed)
Platform                      Linux d3ll521.s5systemsinc.com
                              2.6.33.4-95.fc13.i686 #1 SMP Thu May 13 05:55:24
                              UTC 2010 i686 i686
Alert Count                   1
First Seen                    Wed 02 Jun 2010 10:39:54 AM EDT
Last Seen                     Wed 02 Jun 2010 10:39:54 AM EDT
Local ID                      4659cdd6-e6c4-4fc5-94b8-9f99b696719e
Line Numbers                  

Raw Audit Messages            

node=d3ll521.s5systemsinc.com type=AVC msg=audit(1275489594.632:21): avc:  denied  { read } for  pid=2208 comm="smbd" name="lost+found" dev=sdb5 ino=11 scontext=system_u:system_r:smbd_t:s0 tcontext=system_u:object_r:lost_found_t:s0 tclass=dir

node=d3ll521.s5systemsinc.com type=SYSCALL msg=audit(1275489594.632:21): arch=40000003 syscall=5 success=yes exit=24 a0=24a1320 a1=8000 a2=0 a3=0 items=0 ppid=1483 pid=2208 auid=4294967295 uid=0 gid=0 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=4294967295 comm="smbd" exe="/usr/sbin/smbd" subj=system_u:system_r:smbd_t:s0 key=(null)



Hash String generated from  samba_share,smbd,smbd_t,lost_found_t,dir,read
audit2allow suggests:

#============= smbd_t ==============
#!!!! This avc can be allowed using one of the these booleans:
#     samba_export_all_ro, samba_export_all_ro

allow smbd_t lost_found_t:dir read;

Comment 1 Daniel Walsh 2010-06-02 15:27:42 UTC
What file system are you trying to share?


You can set the samba_export_all_ro or samba_export_all_rw booleans.

Comment 2 Iyengar 2010-06-02 20:28:25 UTC
(In reply to comment #1)
> What file system are you trying to share?
> You can set the samba_export_all_ro or samba_export_all_rw booleans.    

It is an ext3 file system.

Comment 3 Daniel Walsh 2010-06-03 21:17:12 UTC
Not what I meant.  Are you sharing /  Or some other directory?

Comment 4 Iyengar 2010-06-06 16:48:04 UTC
(In reply to comment #3)
> Not what I meant.  Are you sharing /  Or some other directory?    

I notice this error When i try to access my home directory as well as a share drive.  Also I don't seem to have any problems accessing these folders/files.  I noticed these SELinux warnings when I logged into the server for maintenace.

Comment 5 Daniel Walsh 2010-06-07 14:14:40 UTC
You can either turn on the booleans to allow samba to share your entire disk.  Or if this is a share that is particular to samba you can label it samba_share_t.

man samba_selinux

Should give you further explanation.

http://docs.fedoraproject.org/selinux-managing-confined-services-guide/en-US/F11/html/

Also will have some info.


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