Bug 976961 - SELinux is preventing /usr/bin/cp from 'write' accesses on the file /tmp/vbox.0/include/iprt/rand.h.
SELinux is preventing /usr/bin/cp from 'write' accesses on the file /tmp/vbox...
Status: CLOSED DUPLICATE of bug 976939
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
18
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
abrt_hash:2869aa372cd82b9256ac04ff4f3...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-22 01:29 EDT by Moez Roy
Modified: 2013-06-22 07:10 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-22 07:10:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Moez Roy 2013-06-22 01:29:39 EDT
Description of problem:
SELinux is preventing /usr/bin/cp from 'write' accesses on the file /tmp/vbox.0/include/iprt/rand.h.

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

If you want to allow cp to have write access on the rand.h file
Then you need to change the label on /tmp/vbox.0/include/iprt/rand.h
Do
# semanage fcontext -a -t FILE_TYPE '/tmp/vbox.0/include/iprt/rand.h'
where FILE_TYPE is one of the following: abrt_var_run_t, afs_cache_t, alsa_etc_rw_t, apcupsd_lock_t, apmd_lock_t, automount_lock_t, binfmt_misc_fs_t, bluetooth_lock_t, boot_t, cert_t, cgroup_t, condor_var_lock_t, consolekit_log_t, cupsd_lock_t, cupsd_log_t, cyrus_var_lib_t, denyhosts_var_lock_t, device_t, dhcp_etc_t, dhcpc_state_t, dirsrv_var_lock_t, dirsrv_var_run_t, dirsrvadmin_lock_t, drbd_lock_t, etc_aliases_t, etc_mail_t, etc_runtime_t, exports_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, lastlog_t, ld_so_cache_t, likewise_pstore_lock_t, local_login_lock_t, locale_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, mysqld_log_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, psad_var_log_t, puppet_tmp_t, qpidd_var_run_t, quota_flag_t, rhsmcertd_lock_t, ricci_modstorage_lock_t, ricci_var_lib_t, samba_etc_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, sysctl_fs_t, sysctl_t, sysfs_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, wtmp_t, xdm_lock_t. 
Then execute: 
restorecon -v '/tmp/vbox.0/include/iprt/rand.h'


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

If you believe that cp should be allowed write access on the rand.h 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 cp /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                system_u:object_r:usr_t:s0
Target Objects                /tmp/vbox.0/include/iprt/rand.h [ file ]
Source                        cp
Source Path                   /usr/bin/cp
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
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                   6
First Seen                    2013-06-21 22:28:26 PDT
Last Seen                     2013-06-21 22:28:26 PDT
Local ID                      48277600-0175-497d-80c4-223836196a21

Raw Audit Messages
type=AVC msg=audit(1371878906.545:438): avc:  denied  { write } for  pid=2916 comm="cp" path="/tmp/vbox.0/include/iprt/rand.h" dev="tmpfs" ino=33534 scontext=unconfined_u:system_r:initrc_t:s0 tcontext=system_u:object_r:usr_t:s0 tclass=file


Hash: cp,initrc_t,usr_t,file,write

audit2allow

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

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 07:10:11 EDT

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

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