Bug 976968

Summary: SELinux is preventing /usr/bin/cp from 'relabelfrom' accesses on the file timer.h.
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:5d70deec9b2886629671c8438fbd8948cb56303f5872e33876afe8f2ac81c83a
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-22 11:11:05 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 06:03:41 UTC
Description of problem:
SELinux is preventing /usr/bin/cp from 'relabelfrom' accesses on the file timer.h.

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

If you want to allow cp to have relabelfrom access on the timer.h file
Then you need to change the label on timer.h
Do
# semanage fcontext -a -t FILE_TYPE 'timer.h'
where FILE_TYPE is one of the following: dhcpc_state_t, locale_t, net_conf_t, var_lib_nfs_t. 
Then execute: 
restorecon -v 'timer.h'


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

If you believe that cp should be allowed relabelfrom access on the timer.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                timer.h [ file ]
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                   11
First Seen                    2013-06-21 23:02:53 PDT
Last Seen                     2013-06-21 23:02:53 PDT
Local ID                      f71a8645-df04-4085-b52d-36def4c45495

Raw Audit Messages
type=AVC msg=audit(1371880973.155:1260): avc:  denied  { relabelfrom } for  pid=10030 comm="cp" name="timer.h" dev="tmpfs" ino=67130 scontext=unconfined_u:system_r:initrc_t:s0 tcontext=system_u:object_r:usr_t:s0 tclass=file


type=SYSCALL msg=audit(1371880973.155:1260): arch=x86_64 syscall=fsetxattr success=no exit=EACCES a0=4 a1=7ffffc2f99d0 a2=12c1760 a3=1b items=0 ppid=10024 pid=10030 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,file,relabelfrom

audit2allow

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

audit2allow -R
require {
	type initrc_t;
}

#============= initrc_t ==============
files_relabelfrom_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:11:05 UTC

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