Bug 813399 - SELinux is preventing /usr/sbin/tmpwatch from 'write' accesses on the directory 7.0_64.
SELinux is preventing /usr/sbin/tmpwatch from 'write' accesses on the directo...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
16
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
abrt_hash:8003ed95025aa4abc0d48c845c7...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-17 12:16 EDT by superc4
Modified: 2012-09-11 03:46 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-22 09:40:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description superc4 2012-04-17 12:16:44 EDT
libreport version: 2.0.8
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.3.1-5.fc16.x86_64
reason:         SELinux is preventing /usr/sbin/tmpwatch from 'write' accesses on the directory 7.0_64.
time:           Tue 17 Apr 2012 12:16:36 PM EDT

description:
:SELinux is preventing /usr/sbin/tmpwatch from 'write' accesses on the directory 7.0_64.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that tmpwatch should be allowed write access on the 7.0_64 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 tmpwatch /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:tmpreaper_t:s0-s0:c0.c1023
:Target Context                unconfined_u:object_r:user_home_t:s0
:Target Objects                7.0_64 [ dir ]
:Source                        tmpwatch
:Source Path                   /usr/sbin/tmpwatch
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-75.fc16.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.3.1-5.fc16.x86_64 #1
:                              SMP Tue Apr 10 19:56:52 UTC 2012 x86_64 x86_64
:Alert Count                   16
:First Seen                    Tue 17 Apr 2012 11:11:52 AM EDT
:Last Seen                     Tue 17 Apr 2012 11:11:52 AM EDT
:Local ID                      0be8a5d8-42ba-49c5-ab03-bed27aa624c8
:
:Raw Audit Messages
:type=AVC msg=audit(1334675512.680:8460): avc:  denied  { write } for  pid=18854 comm="tmpwatch" name="7.0_64" dev="dm-1" ino=269696 scontext=system_u:system_r:tmpreaper_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir
:
:
:Hash: tmpwatch,tmpreaper_t,user_home_t,dir,write
:
:audit2allow
:
:#============= tmpreaper_t ==============
:#!!!! The source type 'tmpreaper_t' can write to a 'dir' of the following types:
:# httpd_cache_t, kismet_log_t, rpm_var_cache_t, httpd_sys_rw_content_t, print_spool_t, amavis_spool_t, man_t, usr_t, file_t, tmpfile, sandbox_file_t
:
:allow tmpreaper_t user_home_t:dir write;
:
:audit2allow -R
:
:#============= tmpreaper_t ==============
:#!!!! The source type 'tmpreaper_t' can write to a 'dir' of the following types:
:# httpd_cache_t, kismet_log_t, rpm_var_cache_t, httpd_sys_rw_content_t, print_spool_t, amavis_spool_t, man_t, usr_t, file_t, tmpfile, sandbox_file_t
:
:allow tmpreaper_t user_home_t:dir write;
:
Comment 1 Miroslav Grepl 2012-04-20 07:56:11 EDT
Where is "7.0_64" located?
Comment 2 Stef Walter 2012-09-03 05:23:53 EDT
I saw this same issue on a krb5 file in the /tmp directory.


SELinux is preventing /usr/sbin/tmpwatch from 'write' accesses on the directory krb5.

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

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

Additional Information:
Source Context                system_u:system_r:tmpreaper_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                krb5 [ dir ]
Source                        tmpwatch
Source Path                   /usr/sbin/tmpwatch
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           tmpwatch-2.10.3-2.fc17.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-146.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.5.2-3.fc17.x86_64 #1 SMP Tue Aug
                              21 19:06:52 UTC 2012 x86_64 x86_64
Alert Count                   1
First Seen                    2012-09-02 08:30:48 CEST
Last Seen                     2012-09-02 08:30:48 CEST
Local ID                      3d5e1a56-662d-4a3e-8af1-8f1bc52ccc32

Raw Audit Messages
type=AVC msg=audit(1346567448.442:159): avc:  denied  { write } for  pid=4659 comm="tmpwatch" name="krb5" dev="sda1" ino=411297 scontext=system_u:system_r:tmpreaper_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir


type=SYSCALL msg=audit(1346567448.442:159): arch=x86_64 syscall=rmdir success=no exit=EACCES a0=1977a43 a1=404848 a2=1977250 a3=33a61b0778 items=0 ppid=4657 pid=4659 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=3 comm=tmpwatch exe=/usr/sbin/tmpwatch subj=system_u:system_r:tmpreaper_t:s0-s0:c0.c1023 key=(null)

Hash: tmpwatch,tmpreaper_t,user_home_t,dir,write

audit2allow

#============= tmpreaper_t ==============
#!!!! The source type 'tmpreaper_t' can write to a 'dir' of the following types:
# httpd_sys_rw_content_t, print_spool_t, amavis_spool_t, file_t, man_t, tmpfile, sandbox_file_t, kismet_log_t, rpm_var_cache_t, httpd_cache_t

allow tmpreaper_t user_home_t:dir write;

audit2allow -R

#============= tmpreaper_t ==============
#!!!! The source type 'tmpreaper_t' can write to a 'dir' of the following types:
# httpd_sys_rw_content_t, print_spool_t, amavis_spool_t, file_t, man_t, tmpfile, sandbox_file_t, kismet_log_t, rpm_var_cache_t, httpd_cache_t

allow tmpreaper_t user_home_t:dir write;
Comment 3 Miroslav Grepl 2012-09-03 13:02:47 EDT
Stef,
did you move a dir to /tmp directory?
Comment 4 Stef Walter 2012-09-04 02:24:07 EDT
I didn't move this directory explicitly there. But perhaps this was done by a script of some sort. I'll try and keep my eye out for it.
Comment 5 Daniel Walsh 2012-09-06 23:43:15 EDT
I am fixing this in selinux-policy-3.11.1-16.fc18.noarch  Probably not worth backporting.
Comment 6 Miroslav Grepl 2012-09-11 03:46:33 EDT
Backported.

Note You need to log in before you can comment on or make changes to this bug.