Bug 654135

Summary: SELinux is preventing gconf-defaults- (gconfdefaultsm_t) "search" to /home/currentuser/.gconf (user_home_t).
Product: [Fedora] Fedora Reporter: Jay Austen <jaysmobilemail>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: dwalsh, jaysmobilemail, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:de0138e9d3e21406dae3269307c35c3871cebfa647825177bc7d7124d73efa8f
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-17 16:03:58 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 Jay Austen 2010-11-17 00:13:23 UTC
Summary:

SELinux is preventing gconf-defaults- (gconfdefaultsm_t) "search" to
/home/currentuser/.gconf (user_home_t).

Detailed Description:

[gconf-defaults- has a permissive type (gconfdefaultsm_t). This access was not
denied.]

SELinux denied access requested by gconf-defaults-. /home/currentuser/.gconf may
be a mislabeled. /home/currentuser/.gconf default SELinux type is gconf_home_t,
but its current type is user_home_t. Changing this file back to the default
type, may fix your problem.

File contexts can be assigned to a file in the following ways.

  * Files created in a directory receive the file context of the parent
    directory by default.
  * The SELinux policy might override the default label inherited from the
    parent directory by specifying a process running in context A which creates
    a file in a directory labeled B will instead create the file with label C.
    An example of this would be the dhcp client running with the dhclient_t type
    and creates a file in the directory /etc. This file would normally receive
    the etc_t type due to parental inheritance but instead the file is labeled
    with the net_conf_t type because the SELinux policy specifies this.
  * Users can change the file context on a file using tools such as chcon, or
    restorecon.

This file could have been mislabeled either by user error, or if an normally
confined application was run under the wrong domain.

However, this might also indicate a bug in SELinux because the file should not
have been labeled with this type.

If you believe this is a bug, please file a bug report
(http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against this package.

Allowing Access:

You can restore the default system context to this file by executing the
restorecon command. restorecon '/home/currentuser/.gconf', if this file is a
directory, you can recursively restore using restorecon -R
'/home/currentuser/.gconf'.

Fix Command:

restorecon '/home/currentuser/.gconf'

Additional Information:

Source Context                system_u:system_r:gconfdefaultsm_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /home/currentuser/.gconf [ dir ]
Source                        gconf-defaults-
Source Path                   /usr/libexec/gconf-defaults-mechanism
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           GConf2-2.26.2-1.fc11
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.12-62.fc11
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   restorecon
Host Name                     (removed)
Platform                      Linux (removed) 2.6.29.5-191.fc11.i586 #1
                              SMP Tue Jun 16 23:11:39 EDT 2009 i686 i686
Alert Count                   10
First Seen                    Sat 18 Jul 2009 03:52:31 PM EDT
Last Seen                     Sat 18 Jul 2009 04:03:11 PM EDT
Local ID                      a328804a-1971-4440-a6e1-94fdf40b9323
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1247947391.51:33): avc:  denied  { search } for  pid=2849 comm="gconf-defaults-" name=".gconf" dev=dm-1 ino=131320 scontext=system_u:system_r:gconfdefaultsm_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir

node=(removed) type=AVC msg=audit(1247947391.51:33): avc:  denied  { write } for  pid=2849 comm="gconf-defaults-" name=".gconf" dev=dm-1 ino=131320 scontext=system_u:system_r:gconfdefaultsm_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir

node=(removed) type=AVC msg=audit(1247947391.51:33): avc:  denied  { add_name } for  pid=2849 comm="gconf-defaults-" name=".testing.writeability" scontext=system_u:system_r:gconfdefaultsm_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir

node=(removed) type=AVC msg=audit(1247947391.51:33): avc:  denied  { create } for  pid=2849 comm="gconf-defaults-" name=".testing.writeability" scontext=system_u:system_r:gconfdefaultsm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:user_home_t:s0 tclass=file

node=(removed) type=AVC msg=audit(1247947391.51:33): avc:  denied  { write open } for  pid=2849 comm="gconf-defaults-" name=".testing.writeability" dev=dm-1 ino=131130 scontext=system_u:system_r:gconfdefaultsm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:user_home_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1247947391.51:33): arch=40000003 syscall=5 success=yes exit=9 a0=85e3dc0 a1=41 a2=1c0 a3=85e3dc0 items=0 ppid=1 pid=2849 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="gconf-defaults-" exe="/usr/libexec/gconf-defaults-mechanism" subj=system_u:system_r:gconfdefaultsm_t:s0-s0:c0.c1023 key=(null)



Hash String generated from  restorecon,gconf-defaults-,gconfdefaultsm_t,user_home_t,dir,search
audit2allow suggests:

#============= gconfdefaultsm_t ==============
#!!!! The source type 'gconfdefaultsm_t' can write to a 'dir' of the following types:
# gconf_home_t, gconf_etc_t, nfs_t

allow gconfdefaultsm_t user_home_t:dir { write search add_name };
#!!!! The source type 'gconfdefaultsm_t' can write to a 'file' of the following types:
# gconf_home_t, gconf_etc_t, nfs_t

allow gconfdefaultsm_t user_home_t:file { write create open };

Comment 1 Daniel Walsh 2010-11-17 16:03:58 UTC
restroecon -R -v /home/currentuser

Should fix the labeling.

matchpathcon ~/.gconf
/home/devel/dwalsh/.gconf	staff_u:object_r:gconf_home_t:s0