Bug 976929

Summary: SELinux is preventing /usr/lib/udisks2/udisksd from 'rename' accesses on the file fstab.T51FZW.
Product: [Fedora] Fedora Reporter: Moez Roy <moez.roy>
Component: udisks2Assignee: Tomáš Bžatek <tbzatek>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dominick.grift, dwalsh, mgrepl, tbzatek, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:b4a67d804afb3e3dba5c2fd1911fa79708440a90b6be744a97ce45f36b1444aa
Fixed In Version: selinux-policy-3.12.1-59.fc19.noarch Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-13 15:38:50 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 Moez Roy 2013-06-21 23:27:12 UTC
Description of problem:
SELinux is preventing /usr/lib/udisks2/udisksd from 'rename' accesses on the file fstab.T51FZW.

*****  Plugin catchall_labels (83.8 confidence) suggests  ********************

If you want to allow udisksd to have rename access on the fstab.T51FZW file
Then you need to change the label on fstab.T51FZW
Do
# semanage fcontext -a -t FILE_TYPE 'fstab.T51FZW'
where FILE_TYPE is one of the following: device_t, devicekit_tmp_t, devicekit_var_lib_t, devicekit_var_run_t, svirt_image_t, virt_content_t, virt_image_t, xen_image_t. 
Then execute: 
restorecon -v 'fstab.T51FZW'


*****  Plugin catchall (17.1 confidence) suggests  ***************************

If you believe that udisksd should be allowed rename access on the fstab.T51FZW 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 pool /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:devicekit_disk_t:s0
Target Context                system_u:object_r:etc_t:s0
Target Objects                fstab.T51FZW [ file ]
Source                        pool
Source Path                   /usr/lib/udisks2/udisksd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           udisks2-2.1.0-2.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-52.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.9.5-301.fc19.x86_64 #1 SMP Tue
                              Jun 11 19:39:38 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-06-21 19:26:41 EDT
Last Seen                     2013-06-21 19:26:41 EDT
Local ID                      aa96106a-2769-4f37-adb2-3d90729ccec3

Raw Audit Messages
type=AVC msg=audit(1371857201.662:458): avc:  denied  { rename } for  pid=3407 comm="pool" name="fstab.T51FZW" dev="sda2" ino=2360807 scontext=system_u:system_r:devicekit_disk_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=file


type=AVC msg=audit(1371857201.662:458): avc:  denied  { unlink } for  pid=3407 comm="pool" name="fstab" dev="sda2" ino=2359665 scontext=system_u:system_r:devicekit_disk_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=file


type=SYSCALL msg=audit(1371857201.662:458): arch=x86_64 syscall=rename success=yes exit=0 a0=7f3208015f00 a1=7f32190e17cf a2=fffffffffffffdc0 a3=6e2c7665646f6e2c items=0 ppid=1 pid=3407 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=pool exe=/usr/lib/udisks2/udisksd subj=system_u:system_r:devicekit_disk_t:s0 key=(null)

Hash: pool,devicekit_disk_t,etc_t,file,rename

Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.5-301.fc19.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-06-22 10:34:11 UTC
/usr/lib/udisks2/udisksd now edits the /etc/fstab?

Comment 2 Daniel Walsh 2013-06-22 10:34:32 UTC
*** Bug 976930 has been marked as a duplicate of this bug. ***

Comment 3 Tomáš Bžatek 2013-07-02 11:53:13 UTC
(In reply to Daniel Walsh from comment #1)
> /usr/lib/udisks2/udisksd now edits the /etc/fstab?

Well, yes, it does. User is able to configure fstab mounts within gnome-disks, of course backed by polkit authorization.

See e.g. http://cgit.freedesktop.org/udisks/commit/?id=018322ba8d00d9bbee0450910715ae1acde49679
http://cgit.freedesktop.org/udisks/commit/?id=4086b915ebf7bc1a4ad4cec202ffb63682d1bfd0

Comment 4 Daniel Walsh 2013-07-09 16:41:42 UTC
Fixed in selinux-policy-3.12.1-59.fc19.noarch