Bug 812227

Summary: SELinux is preventing /bin/mv from 'associate' accesses on the filesystem null.
Product: [Fedora] Fedora Reporter: gjf <goujunfeng>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: dominick.grift, dwalsh, goujunfeng, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:e28fc61645904df51ce107b12429792d5f289b9f874b55eab448945b2960214b
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-13 16:12:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description gjf 2012-04-13 07:43:34 UTC
SELinux is preventing /bin/mv from 'associate' accesses on the filesystem null.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that mv should be allowed associate access on the null filesystem 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:object_r:user_home_t:s0
Target Context                system_u:object_r:device_t:s0
Target Objects                null [ filesystem ]
Source                        mv
Source Path                   /bin/mv
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           coreutils-8.5-7.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-46.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.35.14-103.fc14.i686 #1 SMP Thu Oct 27 16:15:52
                              UTC 2011 i686
Alert Count                   1
First Seen                    Fri 13 Apr 2012 03:23:10 PM EDT
Last Seen                     Fri 13 Apr 2012 03:23:10 PM EDT
Local ID                      9cd77e35-fef0-4103-92cc-3f68043d3f75

Raw Audit Messages
type=AVC msg=audit(1334344990.756:50): avc:  denied  { associate } for  pid=6506 comm="mv" name="null" scontext=unconfined_u:object_r:user_home_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=filesystem


type=SYSCALL msg=audit(1334344990.756:50): arch=i386 syscall=open success=no exit=EACCES a0=bf850965 a1=80c1 a2=180 a3=180 items=0 ppid=6504 pid=6506 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts2 ses=1 comm=mv exe=/bin/mv subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)

Hash: mv,user_home_t,device_t,filesystem,associate

audit2allow

#============= user_home_t ==============
allow user_home_t device_t:filesystem associate;

audit2allow -R

#============= user_home_t ==============
allow user_home_t device_t:filesystem associate;

Comment 1 gjf 2012-04-13 07:50:49 UTC
i type this command " mv filename  /dev/null"
and i try to use " sudo mv filename  /dev/null"

neither of them  is succeed .

Comment 2 Daniel Walsh 2012-04-13 16:12:36 UTC
Well Fedora 14 is not supported and what you are doing makes no sense.

If you are trying to remove a file then use rm, if you want all apps that write to /dev/null to write to a file?