Bug 427733 - samba_share_t:filesystem getattr denied - no used space/capacity info available for clients
Summary: samba_share_t:filesystem getattr denied - no used space/capacity info availab...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 7
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-07 09:20 UTC by Tomasz Ostrowski
Modified: 2008-01-29 10:54 UTC (History)
0 users

Fixed In Version: 2.6.4-69
Clone Of:
Environment:
Last Closed: 2008-01-29 10:54:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Tomasz Ostrowski 2008-01-07 09:20:27 UTC
Description of problem:
When samba share is on dedicated partition mounted with option
context="system_u:object_r:samba_share_t:s0" then clients are unable to get used
space and capacity information from a share.

The following is logged to audit.log:

type=AVC msg=audit(1199692559.651:766): avc:  denied  { getattr } for  pid=2440
comm="smbd" name="/" dev=sdb1 ino=2 scontext=user_u:system_r:smbd_t:s0
tcontext=system_u:object_r:samba_share_t:s0 tclass=filesystem

type=SYSCALL msg=audit(1199692559.651:766): arch=40000003 syscall=268 success=no
exit=-13 a0=b7ef4677 a1=54 a2=bf8ac548 a3=bf8ac548 items=0 ppid=2347 pid=2440
auid=500 uid=559 gid=0 euid=559 suid=0 fsuid=559 egid=100 sgid=0 fsgid=100
tty=(none) comm="smbd" exe="/usr/sbin/smbd" subj=user_u:system_r:smbd_t:s0
key=(null)


Version-Release number of selected component (if applicable):
selinux-policy-2.6.4-66.fc7
samba-3.0.28-0.fc7

How reproducible:
Always

Steps to Reproduce:

# creating dedicated share partition
service smb stop
dd if=/dev/zero of=/tmp/shares.img bs=1M count=10
mkfs.ext2 -F /tmp/shares.img 
mkdir /tmp/shares
mount -o loop,context="system_u:object_r:samba_share_t:s0" \
  /tmp/shares.img /tmp/shares

# defining share
mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
echo -e "[global]\n\tsecurity=share\n\n" \
  > /etc/samba/smb.conf
echo -e "[test]\n\tguest ok=yes\n\tguest only=yes\n\tpath=/tmp/shares" \
  >> /etc/samba/smb.conf
service smb start
smbclient //localhost/test guest -c "dir"
audit2allow -l < /var/log/audit/audit.log

# cleaning up
service smb stop
mv -f /etc/samba/smb.conf.bak /etc/samba/smb.conf
umount /tmp/shares


Actual results (along output):
0 blocks of size 0. 10 blocks available
allow smbd_t samba_share_t:filesystem getattr;


Expected results (along output):
19822 blocks of size 512. 18614 blocks available

Comment 1 Daniel Walsh 2008-01-08 18:43:58 UTC
You can allow this for now by executing 

# audit2allow -M mypol -i /var/log/audit/audit.log 
# semodule -i mypol.pp

Fixed in selinux-policy-2.6.4-69.fc7


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