Bug 976960 - SELinux is preventing /usr/bin/cp from 'setattr' accesses on the directory internal.
Summary: SELinux is preventing /usr/bin/cp from 'setattr' accesses on the directory in...
Keywords:
Status: CLOSED DUPLICATE of bug 976939
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:a49fc19aea02b3e2e28ccb3392c...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-22 05:29 UTC by Moez Roy
Modified: 2013-06-22 11:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-22 11:09:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Moez Roy 2013-06-22 05:29:16 UTC
Description of problem:
SELinux is preventing /usr/bin/cp from 'setattr' accesses on the directory internal.

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

If you want to allow cp to have setattr access on the internal directory
Then you need to change the label on internal
Do
# semanage fcontext -a -t FILE_TYPE 'internal'
where FILE_TYPE is one of the following: apcupsd_lock_t, apmd_lock_t, asterisk_log_t, asterisk_var_run_t, automount_lock_t, bluetooth_lock_t, condor_var_lock_t, cupsd_lock_t, denyhosts_var_lock_t, device_t, dirsrv_var_lock_t, dirsrv_var_run_t, dirsrvadmin_lock_t, dkim_milter_data_t, drbd_lock_t, faillog_t, fenced_lock_t, fonts_t, ftpd_lock_t, getty_lock_t, greylist_milter_data_t, httpd_lock_t, initrc_state_t, initrc_tmp_t, initrc_var_log_t, ipsec_mgmt_lock_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, mnt_t, mrtg_lock_t, mysqld_db_t, named_conf_t, named_var_run_t, named_zone_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, regex_milter_data_t, rhsmcertd_lock_t, ricci_modstorage_lock_t, ricci_var_lib_t, semanage_read_lock_t, semanage_trans_lock_t, shorewall_lock_t, slapd_lock_t, spamass_milter_data_t, svc_svc_t, system_cronjob_lock_t, tmpfs_t, udev_var_run_t, user_fonts_t, uucpd_lock_t, var_lock_t, var_run_t, virt_cache_t, virt_lock_t, virt_lxc_var_run_t, virt_var_run_t, xdm_lock_t. 
Then execute: 
restorecon -v 'internal'


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

If you believe that cp should be allowed setattr access on the internal directory 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                internal [ dir ]
Source                        cp
Source Path                   /usr/bin/cp
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                   6
First Seen                    2013-06-21 22:28:26 PDT
Last Seen                     2013-06-21 22:28:26 PDT
Local ID                      270bfbd7-120a-4f5c-89f9-52aba483da42

Raw Audit Messages
type=AVC msg=audit(1371878906.545:426): avc:  denied  { setattr } for  pid=2916 comm="cp" name="internal" dev="tmpfs" ino=33510 scontext=unconfined_u:system_r:initrc_t:s0 tcontext=system_u:object_r:usr_t:s0 tclass=dir


type=SYSCALL msg=audit(1371878906.545:426): arch=x86_64 syscall=utimensat success=no exit=EACCES a0=ffffffffffffff9c a1=156b080 a2=7fffb51c75d0 a3=0 items=0 ppid=2914 pid=2916 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=2 tty=pts0 comm=cp exe=/usr/bin/cp subj=unconfined_u:system_r:initrc_t:s0 key=(null)

Hash: cp,initrc_t,usr_t,dir,setattr

audit2allow

#============= initrc_t ==============
allow initrc_t usr_t:dir setattr;

audit2allow -R
require {
	type initrc_t;
}

#============= initrc_t ==============
files_setattr_usr_dirs(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:09:56 UTC

*** 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.