Bug 537476

Summary: SELinux prevented mount from mounting on the file or directory "/mnt/live" (type "dosfs_t").
Product: [Fedora] Fedora Reporter: cheguaka <cheguaka>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:3034e162a61a9cbbad0e0c7abdb4c0e6ab0bf10e1b19d36f09e6ebcf2471b59b
Fixed In Version: 3.6.32-46.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-24 07:48:54 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 cheguaka 2009-11-13 19:24:34 UTC
Summary:

SELinux prevented mount from mounting on the file or directory "/mnt/live" (type
"dosfs_t").

Detailed Description:

SELinux prevented mount from mounting a filesystem on the file or directory
"/mnt/live" of type "dosfs_t". By default SELinux limits the mounting of
filesystems to only some files or directories (those with types that have the
mountpoint attribute). The type "dosfs_t" does not have this attribute. You can
change the label of the file or directory.

Allowing Access:

Changing the file_context to mnt_t will allow mount to mount the file system:
"chcon -t mnt_t '/mnt/live'." 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 mnt_t '/mnt/live'"

Fix Command:

chcon -t mnt_t '/mnt/live'

Additional Information:

Source Context                system_u:system_r:mount_t:s0
Target Context                system_u:object_r:dosfs_t:s0
Target Objects                /mnt/live [ dir ]
Source                        mount
Source Path                   /bin/mount
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           util-linux-ng-2.16-10.2.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-41.fc12
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   mounton
Host Name                     (removed)
Platform                      Linux (removed) 2.6.31.5-127.fc12.i686
                              #1 SMP Sat Nov 7 21:41:45 EST 2009 i686 i686
Alert Count                   3
First Seen                    Thu 12 Nov 2009 09:47:56 PM EST
Last Seen                     Thu 12 Nov 2009 09:47:56 PM EST
Local ID                      a2a6deff-7f05-4073-845c-76e347cfc755
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1258080476.872:32821): avc:  denied  { mounton } for  pid=3031 comm="mount" path="/mnt/live" dev=sda3 ino=1 scontext=system_u:system_r:mount_t:s0 tcontext=system_u:object_r:dosfs_t:s0 tclass=dir

node=(removed) type=SYSCALL msg=audit(1258080476.872:32821): arch=40000003 syscall=21 success=no exit=-13 a0=1f70cb0 a1=1f70e40 a2=1f71bc8 a3=c0ed0001 items=0 ppid=2990 pid=3031 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="mount" exe="/bin/mount" subj=system_u:system_r:mount_t:s0 key=(null)



Hash String generated from  selinux-policy-3.6.32-41.fc12,mounton,mount,mount_t,dosfs_t,dir,mounton
audit2allow suggests:

#============= mount_t ==============
allow mount_t dosfs_t:dir mounton;

Comment 1 Daniel Walsh 2009-11-13 19:37:20 UTC
Are you mounting a file system on top of a dos file system?

Comment 2 cheguaka 2009-11-13 20:33:09 UTC
Yes. Is the live cd  copied to a vfat partition booted from grub. 

From grub:

title Fedora_12_Beta
        root (hd0,2)
        kernel /isolinux/vmlinuz0 root=UUID=48F6-4212 rootfstype=vfat rw liveimg reset_overlay overlay=/LiveOS/overlay--48F6-4212 rdshell rdinitdebug
        initrd /isolinux/initrd0.img


So I can try daily builds of live cd without copy it to a usb.

Comment 3 Daniel Walsh 2009-11-13 20:48:01 UTC
You can add these rules for now using

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

Fixed in selinux-policy-3.6.32-45.fc12.noarch

Comment 4 Fedora Update System 2009-11-16 19:38:02 UTC
selinux-policy-3.6.32-46.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-46.fc12

Comment 5 Fedora Update System 2009-11-18 14:11:56 UTC
selinux-policy-3.6.32-46.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-11672

Comment 6 Fedora Update System 2009-11-24 07:46:52 UTC
selinux-policy-3.6.32-46.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.