Bug 789012

Summary: SELinux is preventing /opt/google/chrome/chrome-sandbox from read, append access on the file /data/.xsession-errors.
Product: [Fedora] Fedora Reporter: Stef Walter <stefw>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:5ca821ab412191c791f40c6d10e51b31c7ac86bfbf8e09626ccde131d285d6c2
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-09 19:52:41 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 Stef Walter 2012-02-09 15:22:00 UTC
libreport version: 2.0.8
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.2.3-2.fc16.x86_64
reason:         SELinux is preventing /opt/google/chrome/chrome-sandbox from read, append access on the file /data/.xsession-errors.
time:           Thu 09 Feb 2012 04:21:47 PM CET

description:
:SELinux is preventing /opt/google/chrome/chrome-sandbox from read, append access on the file /data/.xsession-errors.
:
:*****  Plugin catchall_labels (71.9 confidence) suggests  ********************
:
:If you want to allow chrome-sandbox to have read append access on the .xsession-errors file
:Then you need to change the label on /data/.xsession-errors
:Do
:# semanage fcontext -a -t FILE_TYPE '/data/.xsession-errors'
:where FILE_TYPE is one of the following: cgroup_t, user_fonts_cache_t, user_tmpfs_t, chrome_sandbox_tmpfs_t, chrome_sandbox_tmp_t, gnome_home_type, chrome_sandbox_t, user_cron_spool_t, home_cert_t. 
:Then execute: 
:restorecon -v '/data/.xsession-errors'
:
:
:*****  Plugin catchall (14.7 confidence) suggests  ***************************
:
:If you believe that chrome-sandbox should be allowed read append access on the .xsession-errors file 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 chrome-sandbox /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:*****  Plugin leaks (14.7 confidence) suggests  ******************************
:
:If you want to ignore chrome-sandbox trying to read append access the .xsession-errors file, because you believe it should not need this access.
:Then you should report this as a bug.  
:You can generate a local policy module to dontaudit this access.
:Do
:# grep /opt/google/chrome/chrome-sandbox /var/log/audit/audit.log | audit2allow -D -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                unconfined_u:unconfined_r:chrome_sandbox_t:s0-s0:c
:                              0.c1023
:Target Context                system_u:object_r:default_t:s0
:Target Objects                /data/.xsession-errors [ file ]
:Source                        chrome-sandbox
:Source Path                   /opt/google/chrome/chrome-sandbox
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           google-chrome-stable-17.0.963.46-119351.x86_64
: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.2.3-2.fc16.x86_64 #1 SMP Fri Feb 3 20:08:08 UTC
:                              2012 x86_64 x86_64
:Alert Count                   3
:First Seen                    Thu 09 Feb 2012 04:20:50 PM CET
:Last Seen                     Thu 09 Feb 2012 04:20:54 PM CET
:Local ID                      3c5d990a-26d4-470e-9de8-ed0ebd3d992d
:
:Raw Audit Messages
:type=AVC msg=audit(1328800854.213:114): avc:  denied  { read append } for  pid=2615 comm="chrome-sandbox" path="/data/.xsession-errors" dev=dm-3 ino=7340040 scontext=unconfined_u:unconfined_r:chrome_sandbox_t:s0-s0:c0.c1023 tcontext=system_u:object_r:default_t:s0 tclass=filenode=(removed) type=AVC msg=audit(1328800854.213:114): avc:  denied  { read append } for  pid=2615 comm="chrome-sandbox" path="/data/.xsession-errors" dev=dm-3 ino=7340040 scontext=unconfined_u:unconfined_r:chrome_sandbox_t:s0-s0:c0.c1023 tcontext=system_u:object_r:default_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1328800854.213:114): arch=x86_64 syscall=execve success=yes exit=0 a0=7f0560003498 a1=7f05605bb390 a2=7f0560022d80 a3=7f0545d7f790 items=0 ppid=2506 pid=2615 auid=1000 uid=1000 gid=1000 euid=0 suid=0 fsuid=0 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=5 comm=chrome-sandbox exe=/opt/google/chrome/chrome-sandbox subj=unconfined_u:unconfined_r:chrome_sandbox_t:s0-s0:c0.c1023 key=(null)
:
:Hash: chrome-sandbox,chrome_sandbox_t,default_t,file,read,append
:
:audit2allow
:
:#============= chrome_sandbox_t ==============
:allow chrome_sandbox_t default_t:file { read append };
:
:audit2allow -R
:
:#============= chrome_sandbox_t ==============
:allow chrome_sandbox_t default_t:file { read append };
:

Comment 1 Miroslav Grepl 2012-02-09 19:52:41 UTC
You need to tell SELinux how 

/data/.xsession-errors

should be labeled because /data is non standard directory. 

$ semanage fcontext -a -e /home/user /data
$ restorecon -R -v /data

will tell SELinux to label /data as /home/<user>

Comment 2 Stef Walter 2012-02-09 19:58:21 UTC
So all users of chrome need to do this?

Comment 3 Stef Walter 2012-02-09 20:03:22 UTC
Ah, someone enlightened me on IRC. Makes sense now. Thanks!

Comment 4 Miroslav Grepl 2012-02-09 20:07:12 UTC
I guess not all users have the same configuration as you. This works fine for usual configurations.

But if a user report a similar bug, yes, he need to do this.


What does matchpathcon without suggested change?

$ semanage fcontext -d -e /home/user /data
$ matchpathcon /data/.xsession-errors

Comment 5 Miroslav Grepl 2012-02-09 20:07:26 UTC
*** Bug 789028 has been marked as a duplicate of this bug. ***