Bug 699939

Summary: SELinux is preventing /usr/bin/xauth from 'remove_name' accesses on the directory /yum_20110421080748/home/naoki/.Xauthority.
Product: [Fedora] Fedora Reporter: Naoki <naoki>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:3a8ef1cbfe5ae16a46ee2998893bd966a85f39c47012e069409d73411b3c793b
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-27 09:06:27 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 Naoki 2011-04-27 01:01:35 UTC
SELinux is preventing /usr/bin/xauth from 'remove_name' accesses on the directory /yum_20110421080748/home/naoki/.Xauthority.

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

If you believe that xauth should be allowed remove_name access on the .Xauthority 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 xauth /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:xauth_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:home_root_t:s0
Target Objects                /yum_20110421080748/home/naoki/.Xauthority [ dir ]
Source                        xauth
Source Path                   /usr/bin/xauth
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           xorg-x11-xauth-1.0.2-9.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-15.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.2-9.fc15.x86_64 #1 SMP
                              Wed Mar 30 16:55:57 UTC 2011 x86_64 x86_64
Alert Count                   6
First Seen                    Tue 12 Apr 2011 07:06:06 PM JST
Last Seen                     Fri 22 Apr 2011 12:31:49 PM JST
Local ID                      efad2e29-778d-4837-af06-933dbedeac66

Raw Audit Messages
type=AVC msg=audit(1303443109.430:1560): avc:  denied  { remove_name } for  pid=8654 comm="xauth" name=".Xauthority" dev=dm-1 ino=672752 scontext=unconfined_u:unconfined_r:xauth_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:home_root_t:s0 tclass=dir


type=AVC msg=audit(1303443109.430:1560): avc:  denied  { unlink } for  pid=8654 comm="xauth" name=".Xauthority" dev=dm-1 ino=672752 scontext=unconfined_u:unconfined_r:xauth_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:home_root_t:s0 tclass=file


type=SYSCALL msg=audit(1303443109.430:1560): arch=x86_64 syscall=unlink success=yes exit=0 a0=1168030 a1=3fc4398238 a2=0 a3=0 items=0 ppid=8653 pid=8654 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=pts4 ses=193 comm=xauth exe=/usr/bin/xauth subj=unconfined_u:unconfined_r:xauth_t:s0-s0:c0.c1023 key=(null)

Hash: xauth,xauth_t,home_root_t,dir,remove_name

audit2allow

#============= xauth_t ==============
allow xauth_t home_root_t:dir remove_name;
allow xauth_t home_root_t:file unlink;

audit2allow -R

#============= xauth_t ==============
allow xauth_t home_root_t:dir remove_name;
allow xauth_t home_root_t:file unlink;

Comment 1 Miroslav Grepl 2011-04-27 09:06:27 UTC
You need to setup the proper context for /yum_20110421080748/home/naoki using semanage

# semanage fcontext -a -t home_root_t "/yum_20110421080748"
# semanage fcontext -a -e /home /yum_20110421080748/home
# restorecon -R -v /yum_20110421080748

which will tell SELinux to label /yum_20110421080748/home/naoki as /home/naoki.