Bug 817612

Summary: SELinux is preventing /bin/systemd-tmpfiles from 'rmdir' accesses on the directory long.
Product: [Fedora] Fedora Reporter: long
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:f18c086dec7d10839f31bed31fcacfd6eb80e0a62519876fda66a315c2d78d53
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-22 13:15:01 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 long 2012-04-30 16:06:26 UTC
SELinux is preventing /bin/systemd-tmpfiles from 'rmdir' accesses on the directory long.

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

If you believe that systemd-tmpfiles should be allowed rmdir access on the long 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 systemd-tmpfile /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:systemd_tmpfiles_t:s0
Target Context                unconfined_u:object_r:user_home_dir_t:s0
Target Objects                long [ dir ]
Source                        systemd-tmpfile
Source Path                   /bin/systemd-tmpfiles
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           systemd-units-26-18.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-52.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.42.12-1.fc15.x86_64 #1
                              SMP Tue Mar 20 16:30:08 UTC 2012 x86_64 x86_64
Alert Count                   1
First Seen                    Mon 30 Apr 2012 10:13:00 AM CDT
Last Seen                     Mon 30 Apr 2012 10:13:00 AM CDT
Local ID                      b3be392d-79a1-47db-9575-753544407b6f

Raw Audit Messages
type=AVC msg=audit(1335798780.495:100): avc:  denied  { rmdir } for  pid=4289 comm="systemd-tmpfile" name="long" dev=sdb3 ino=8519716 scontext=system_u:system_r:systemd_tmpfiles_t:s0 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir


type=SYSCALL msg=audit(1335798780.495:100): arch=x86_64 syscall=unlinkat success=yes exit=0 a0=5 a1=1ddf4ab a2=200 a3=200 items=0 ppid=1 pid=4289 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=systemd-tmpfile exe=/bin/systemd-tmpfiles subj=system_u:system_r:systemd_tmpfiles_t:s0 key=(null)

Hash: systemd-tmpfile,systemd_tmpfiles_t,user_home_dir_t,dir,rmdir

audit2allow

#============= systemd_tmpfiles_t ==============
allow systemd_tmpfiles_t user_home_dir_t:dir rmdir;

audit2allow -R

#============= systemd_tmpfiles_t ==============
allow systemd_tmpfiles_t user_home_dir_t:dir rmdir;

Comment 1 Daniel Walsh 2012-05-01 18:17:10 UTC
Did you mv your homedir to /tmp?

rm -rf /tmp/long

Should clean this up. We really do not want to allow systemd-tmpfiles to delete the contents of homedirs.

Comment 2 long 2012-05-01 20:11:38 UTC
That's what I'm confused about.  There is no /tmp/long (at least now, I have no idea if there was one there or not) and I can't tell from the audit message what it was trying to delete?

Comment 3 Daniel Walsh 2012-05-02 17:58:01 UTC
Well the only way I can imagine this happening would be if you have a directory like /home/long and you mv'd it to /tmp.  Then eventually systemd-tmpfiles see it as old and attempts to remove it.