Bug 976964

Summary: SELinux is preventing /usr/bin/mv from 'rename' accesses on the file .SUPDrv-linux.o.tmp.
Product: [Fedora] Fedora Reporter: Moez Roy <moez.roy>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:9d5bff4ef91c6577bf346131db9a1bab61857037044201663432ed08565f671e
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-22 11:10:19 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-22 05:50:20 UTC
Description of problem:
SELinux is preventing /usr/bin/mv from 'rename' accesses on the file .SUPDrv-linux.o.tmp.

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

If you want to allow mv to have rename access on the .SUPDrv-linux.o.tmp file
Then you need to change the label on .SUPDrv-linux.o.tmp
Do
# semanage fcontext -a -t FILE_TYPE '.SUPDrv-linux.o.tmp'
where FILE_TYPE is one of the following: abrt_var_run_t, alsa_etc_rw_t, apcupsd_lock_t, apmd_lock_t, automount_lock_t, bluetooth_lock_t, boot_t, cert_t, condor_var_lock_t, consolekit_log_t, cupsd_lock_t, denyhosts_var_lock_t, device_t, dhcpc_state_t, dirsrv_var_lock_t, dirsrv_var_run_t, dirsrvadmin_lock_t, drbd_lock_t, etc_aliases_t, etc_runtime_t, faillog_t, fenced_lock_t, fonts_t, ftpd_lock_t, gconf_etc_t, getty_lock_t, glance_var_run_t, httpd_lock_t, initrc_state_t, initrc_tmp_t, initrc_var_log_t, initrc_var_run_t, ipsec_mgmt_lock_t, ipsec_var_run_t, iscsi_lock_t, krb5kdc_lock_t, likewise_pstore_lock_t, local_login_lock_t, lockdev_lock_t, logrotate_lock_t, logwatch_lock_t, lvm_lock_t, mailman_lock_t, mandb_lock_t, mdadm_var_run_t, mnt_t, mrtg_lock_t, named_conf_t, net_conf_t, pkcsslotd_lock_t, pki_ra_lock_t, pki_tomcat_lock_t, pki_tps_lock_t, postgresql_db_t, postgresql_lock_t, pppd_lock_t, qpidd_var_run_t, quota_flag_t, rhsmcertd_lock_t, ricci_modstorage_lock_t, ricci_var_lib_t, sanlock_var_run_t, semanage_read_lock_t, semanage_trans_lock_t, shorewall_lock_t, slapd_lock_t, squid_log_t, svc_svc_t, system_conf_t, system_cronjob_lock_t, system_dbusd_var_lib_t, systemd_passwd_var_run_t, udev_rules_t, udev_var_run_t, uucpd_lock_t, var_lib_nfs_t, var_lib_t, var_lock_t, var_log_t, var_spool_t, virt_cache_t, virt_lock_t, virt_var_lib_t, wdmd_var_run_t, xdm_lock_t. 
Then execute: 
restorecon -v '.SUPDrv-linux.o.tmp'


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

If you believe that mv should be allowed rename access on the .SUPDrv-linux.o.tmp 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 mv /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:system_r:initrc_t:s0
Target Context                unconfined_u:object_r:usr_t:s0
Target Objects                .SUPDrv-linux.o.tmp [ file ]
Source                        mv
Source Path                   /usr/bin/mv
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           coreutils-8.17-8.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-97.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.6-200.fc18.x86_64 #1 SMP Thu
                              Jun 13 18:56:55 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-06-21 22:49:14 PDT
Last Seen                     2013-06-21 22:49:14 PDT
Local ID                      16693ada-2b3b-4423-935f-0ee87086b7a3

Raw Audit Messages
type=AVC msg=audit(1371880154.487:1034): avc:  denied  { rename } for  pid=7378 comm="mv" name=".SUPDrv-linux.o.tmp" dev="tmpfs" ino=53733 scontext=unconfined_u:system_r:initrc_t:s0 tcontext=unconfined_u:object_r:usr_t:s0 tclass=file


type=SYSCALL msg=audit(1371880154.487:1034): arch=x86_64 syscall=rename success=no exit=EACCES a0=7fff2ce34826 a1=7fff2ce3484c a2=17 a3=2 items=0 ppid=6748 pid=7378 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=2 tty=pts0 comm=mv exe=/usr/bin/mv subj=unconfined_u:system_r:initrc_t:s0 key=(null)

Hash: mv,initrc_t,usr_t,file,rename

audit2allow

#============= initrc_t ==============
allow initrc_t usr_t:file rename;

audit2allow -R
require {
	type initrc_t;
}

#============= initrc_t ==============
files_manage_usr_files(initrc_t)


Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.6-200.fc18.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-06-22 11:10:19 UTC

*** This bug has been marked as a duplicate of bug 976939 ***