Bug 863678 - SELinux is preventing /usr/sbin/tmpwatch from 'setattr' accesses on the directory /var/cache/man/cat1.
SELinux is preventing /usr/sbin/tmpwatch from 'setattr' accesses on the direc...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-10-06 11:27 EDT by Elad Alfassa
Modified: 2012-10-15 05:08 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-10-15 05:08:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
File: type (9 bytes, text/plain)
2012-10-06 11:27 EDT, Elad Alfassa
no flags Details
File: hashmarkername (14 bytes, text/plain)
2012-10-06 11:27 EDT, Elad Alfassa
no flags Details

  None (edit)
Description Elad Alfassa 2012-10-06 11:27:39 EDT
Additional info:
libreport version: 2.0.14
kernel:         3.6.0-1.fc18.x86_64

:SELinux is preventing /usr/sbin/tmpwatch from 'setattr' accesses on the directory /var/cache/man/cat1.
:*****  Plugin catchall (100. confidence) suggests  ***************************
:If you believe that tmpwatch should be allowed setattr access on the cat1 directory by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
: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                system_u:object_r:mandb_cache_t:s0
:Target Objects                /var/cache/man/cat1 [ dir ]
:Source                        tmpwatch
:Source Path                   /usr/sbin/tmpwatch
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           tmpwatch-2.11-2.fc18.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.11.1-32.fc18.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Permissive
:Host Name                     (removed)
:Platform                      Linux (removed) 3.6.0-1.fc18.x86_64 #1 SMP Mon Oct
:                              1 16:02:25 UTC 2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    2012-10-06 17:26:42 IST
:Last Seen                     2012-10-06 17:26:42 IST
:Local ID                      630eac99-497a-440d-9d0c-d21833e4face
:Raw Audit Messages
:type=AVC msg=audit(1349537202.472:74): avc:  denied  { setattr } for  pid=9710 comm="tmpwatch" name="cat1" dev="sda6" ino=786896 scontext=system_u:system_r:tmpreaper_t:s0-s0:c0.c1023 tcontext=system_u:object_r:mandb_cache_t:s0 tclass=dir
:type=SYSCALL msg=audit(1349537202.472:74): arch=x86_64 syscall=utime success=yes exit=0 a0=404923 a1=7fff4ad77060 a2=15000 a3=8028 items=0 ppid=9706 pid=9710 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,mandb_cache_t,dir,setattr
:#============= tmpreaper_t ==============
:allow tmpreaper_t mandb_cache_t:dir setattr;
:audit2allow -R
:#============= tmpreaper_t ==============
:allow tmpreaper_t mandb_cache_t:dir setattr;
Comment 1 Elad Alfassa 2012-10-06 11:27:43 EDT
Created attachment 622736 [details]
File: type
Comment 2 Elad Alfassa 2012-10-06 11:27:46 EDT
Created attachment 622737 [details]
File: hashmarkername
Comment 3 Miroslav Grepl 2012-10-08 04:09:52 EDT
Fixed in selinux-policy-3.11.1-33.fc18
Comment 4 Adam Williamson 2012-10-09 13:09:52 EDT
Wasn't doing anything directly to trigger this, appears to have happened in the background.

Package: (null)
OS Release: Fedora release 18 (Spherical Cow)
Comment 5 Daniel Walsh 2012-10-09 14:20:55 EDT
Right there is new policy for mandb which labels /var/cache/man as mandb_cache_t but I guess tmpfiles needs to be able to list and delete content from this directory.
Comment 6 Fedora Update System 2012-10-11 05:03:53 EDT
selinux-policy-3.11.1-36.fc18 has been submitted as an update for Fedora 18.
Comment 7 Fedora Update System 2012-10-11 13:22:28 EDT
Package selinux-policy-3.11.1-36.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-36.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 8 Jeff Bastian 2012-10-12 08:02:02 EDT
cron ran tmpwatch overnight and this error was waiting for me in the morning.

I see this director -- /var/cache/man/... -- in /etc/cron.daily/tmpwatch:

for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
    if [ -d "$d" ]; then
	/usr/sbin/tmpwatch "$flags" -f 30d "$d"

Package: (null)
OS Release: Fedora release 18 (Spherical Cow)
Comment 9 Daniel Walsh 2012-10-12 09:00:43 EDT
Have you installed the latest policy?
Comment 10 Jeff Bastian 2012-10-12 10:26:59 EDT
I just did, after seeing comment 7 above.  And I did an autorelabel just to be sure.

I then manually ran /etc/cron.daily/tmpwatch and it appeared to run fine: no new AVCs!


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