Bug 727949

Summary: SELinux is preventing /usr/sbin/smbd from 'getattr' accesses on the file /home/data/Movies/The.Big.Bang.Theory.S04E04.rus.HDTVrip.[Kuraj-Bambey.Ru].avi.
Product: [Fedora] Fedora Reporter: etnomax
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:c11f63e387ebcb77684d0004a5bc1d879ce75da8bf651c8365598134f9304994
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-04 04:39:31 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 etnomax 2011-08-03 18:39:15 UTC
SELinux is preventing /usr/sbin/smbd from 'getattr' accesses on the file /home/data/Movies/The.Big.Bang.Theory.S04E04.rus.HDTVrip.[Kuraj-Bambey.Ru].avi.

*****  Plugin restorecon (85.9 confidence) suggests  *************************

If you want to fix the label. 
/home/data/Movies/The.Big.Bang.Theory.S04E04.rus.HDTVrip.[Kuraj-Bambey.Ru].avi default label should be user_home_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /home/data/Movies/The.Big.Bang.Theory.S04E04.rus.HDTVrip.[Kuraj-Bambey.Ru].avi

*****  Plugin catchall_boolean (7.33 confidence) suggests  *******************

If you want to allow samba to share any file/directory read only.
Then you must tell SELinux about this by enabling the 'samba_export_all_ro' boolean.
Do
setsebool -P samba_export_all_ro 1

*****  Plugin catchall_boolean (7.33 confidence) suggests  *******************

If you want to allow samba to share any file/directory read/write.
Then you must tell SELinux about this by enabling the 'samba_export_all_rw' boolean.
Do
setsebool -P samba_export_all_rw 1

*****  Plugin catchall (1.35 confidence) suggests  ***************************

If you believe that smbd should be allowed getattr access on the The.Big.Bang.Theory.S04E04.rus.HDTVrip.[Kuraj-Bambey.Ru].avi file 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 smbd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:smbd_t:s0
Target Context                unconfined_u:object_r:home_root_t:s0
Target Objects                /home/data/Movies/The.Big.Bang.Theory.S04E04.rus.H
                              DTVrip.[Kuraj-Bambey.Ru].avi [ file ]
Source                        smbd
Source Path                   /usr/sbin/smbd
Port                          <Неизвестно>
Host                          (removed)
Source RPM Packages           samba-3.5.8-68.fc15.1
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-35.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.40-4.fc15.x86_64 #1 SMP Fri
                              Jul 29 18:46:53 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Ср. 03 авг. 2011 21:35:51
Last Seen                     Ср. 03 авг. 2011 21:35:51
Local ID                      84b1218b-c3b6-4b4e-a470-6e4fcaa64dce

Raw Audit Messages
type=AVC msg=audit(1312396551.150:135): avc:  denied  { getattr } for  pid=3522 comm="smbd" path="/home/data/Movies/The.Big.Bang.Theory.S04E04.rus.HDTVrip.[Kuraj-Bambey.Ru].avi" dev=sda3 ino=10092556 scontext=system_u:system_r:smbd_t:s0 tcontext=unconfined_u:object_r:home_root_t:s0 tclass=file


type=SYSCALL msg=audit(1312396551.150:135): arch=x86_64 syscall=stat success=yes exit=0 a0=7f729b7c9070 a1=7fffb90ea6c0 a2=7fffb90ea6c0 a3=482e7375722e3430 items=0 ppid=3036 pid=3522 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: smbd,smbd_t,home_root_t,file,getattr

audit2allow

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

allow smbd_t home_root_t:file getattr;

audit2allow -R

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

allow smbd_t home_root_t:file getattr;

Comment 1 Daniel Walsh 2011-08-03 19:37:17 UTC
I take it /home/data is not a real users homedir?  Do you want to share all of the content in this directory via samba?

Comment 2 etnomax 2011-08-04 04:39:31 UTC
It's not a real user homedir. It's just a share folder. It's not actual for me. Problem didn't appear again.
Thank you.

Comment 3 Miroslav Grepl 2011-08-05 07:54:55 UTC
*****  Plugin catchall_boolean (7.33 confidence) suggests  *******************

If you want to allow samba to share any file/directory read only.
Then you must tell SELinux about this by enabling the 'samba_export_all_ro'
boolean.
Do

setsebool -P samba_export_all_ro 1