Bug 1023939 - SELinux is preventing /usr/bin/gsf-office-thumbnailer from 'write' accesses on the directory /home/brian/tmp.
SELinux is preventing /usr/bin/gsf-office-thumbnailer from 'write' accesses o...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2013-10-28 07:53 EDT by Brian J. Murrell
Modified: 2014-06-09 08:01 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-09 08:01:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Brian J. Murrell 2013-10-28 07:53:04 EDT
Description of problem:
SELinux is preventing /usr/bin/gsf-office-thumbnailer from 'write' accesses on the directory /home/brian/tmp.

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

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

Additional Information:
Source Context                unconfined_u:unconfined_r:thumb_t:s0-s0:c0.c1023
Target Context                system_u:object_r:user_home_t:s0
Target Objects                /home/brian/tmp [ dir ]
Source                        gsf-office-thum
Source Path                   /usr/bin/gsf-office-thumbnailer
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           libgsf-1.14.26-4.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-74.9.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.11.4-201.fc19.x86_64 #1 SMP Thu
                              Oct 10 14:11:18 UTC 2013 x86_64 x86_64
Alert Count                   2
First Seen                    2013-10-27 19:28:44 EDT
Last Seen                     2013-10-27 19:28:44 EDT
Local ID                      e292c26d-7f16-4e32-a228-f97da63a1622

Raw Audit Messages
type=AVC msg=audit(1382916524.972:530): avc:  denied  { write } for  pid=2345 comm="gsf-office-thum" name="tmp" dev="dm-5" ino=131487 scontext=unconfined_u:unconfined_r:thumb_t:s0-s0:c0.c1023 tcontext=system_u:object_r:user_home_t:s0 tclass=dir

type=SYSCALL msg=audit(1382916524.972:530): arch=x86_64 syscall=open success=no exit=EACCES a0=1401e20 a1=c2 a2=180 a3=0 items=0 ppid=2175 pid=2345 auid=1001 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=1 tty=(none) comm=gsf-office-thum exe=/usr/bin/gsf-office-thumbnailer subj=unconfined_u:unconfined_r:thumb_t:s0-s0:c0.c1023 key=(null)

Hash: gsf-office-thum,thumb_t,user_home_t,dir,write

Additional info:
reporter:       libreport-2.1.8
hashmarkername: setroubleshoot
kernel:         3.11.4-201.fc19.x86_64
type:           libreport
Comment 1 Daniel Walsh 2013-10-28 17:10:18 EDT
Did you setup the /tmp directory to point at tmp in your homedir?
Comment 2 Brian J. Murrell 2013-10-29 22:36:11 EDT
No.  But I do have $TMPDIR pointing to ~/tmp.
Comment 3 Daniel Walsh 2013-11-04 11:36:19 EST
Try as root.

# semanage fcontext -a -t user_tmp_t "/home/brian/tmp"
# restorecon -R -v /home/brian/tmp

That should at least get the top level directory labeled correctly.

If you could remove all content from that directory, other tools should be working correctly.
Comment 4 Brian J. Murrell 2013-11-04 11:54:21 EST
OK.  Done.  I guess we wait and see if I get any more errors.
Comment 5 Brian J. Murrell 2013-12-03 08:47:42 EST
OK.  So I got another one of these AVC denials and my ~/tmp looks labeled as directed:

$ ls -ldZ ~/tmp
drwx-----x. brian brian system_u:object_r:user_tmp_t:s0  /home/brian/tmp
Comment 6 Daniel Walsh 2013-12-04 08:45:29 EST
Could you attach the actual avc?
Comment 7 Brian J. Murrell 2013-12-18 08:25:32 EST
(In reply to Daniel Walsh from comment #6)
> Could you attach the actual avc?

What does that mean exactly?

I usually get these alerts in the "SELinux Troubleshooter"/"SELinux Alert Browser" application.

I am happy to go collect information from somewhere else if that would help though.  Just tell me where to collect from.
Comment 8 Daniel Walsh 2013-12-19 15:07:43 EST
The bottom of the alert messages or the output of 

# ausearch -m avc -ts recent -i
Comment 9 Brian J. Murrell 2014-06-09 08:01:54 EDT
(In reply to Daniel Walsh from comment #6)
> Could you attach the actual avc?

I'm afraid this must have gotten push off of the stack (in my brain) during a stack overflow.  Clearly too much time has passed to get this relevant information.  I will just close this now and re-open if it happens again.

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