Bug 530419 - SELinux is preventing consoletype (consoletype_t) "write" to /home/julroy67/.xsession-errors (user_home_t).
Summary: SELinux is preventing consoletype (consoletype_t) "write" to /home/julroy67/....
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11-xinit
Version: 12
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: X/OpenGL Maintenance List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:d91b5be163a...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-22 18:07 UTC by Julien Humbert
Modified: 2018-04-11 11:05 UTC (History)
5 users (show)

Fixed In Version: 1.0.9-13.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-20 05:26:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Julien Humbert 2009-10-22 18:07:40 UTC
Résumé:

SELinux is preventing consoletype (consoletype_t) "write" to
/home/julroy67/.xsession-errors (user_home_t).

Description détaillée:

[consoletype has a permissive type (consoletype_t). This access was not denied.]

SELinux denied access requested by consoletype. /home/julroy67/.xsession-errors
may be a mislabeled. /home/julroy67/.xsession-errors default SELinux type is
xdm_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.

Autoriser l'accès:

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

Commande de correction:

restorecon '/home/julroy67/.xsession-errors'

Informations complémentaires:

Contexte source               unconfined_u:system_r:consoletype_t:s0
Contexte cible                unconfined_u:object_r:user_home_t:s0
Objets du contexte            /home/julroy67/.xsession-errors [ file ]
source                        consoletype
Chemin de la source           /sbin/consoletype
Port                          <Inconnu>
Hôte                         (removed)
Paquetages RPM source         initscripts-8.95-1
Paquetages RPM cible          
Politique RPM                 selinux-policy-3.6.12-85.fc11
Selinux activé               True
Type de politique             targeted
MLS activé                   True
Mode strict                   Enforcing
Nom du plugin                 restorecon
Nom de l'hôte                (removed)
Plateforme                    Linux (removed) 2.6.30.8-64.fc11.x86_64 #1 SMP
                              Fri Sep 25 04:43:32 EDT 2009 x86_64 x86_64
Compteur d'alertes            3
Première alerte              mer. 10 juin 2009 15:12:26 CEST
Dernière alerte              mer. 10 juin 2009 17:04:47 CEST
ID local                      65170da0-c2c7-4f24-a0ee-6c144d360096
Numéros des lignes           

Messages d'audit bruts        

node=(removed) type=AVC msg=audit(1244639546.303:22): avc:  denied  { write } for  pid=2586 comm="consoletype" path="/home/julroy67/.xsession-errors" dev=dm-0 ino=131263 scontext=unconfined_u:system_r:consoletype_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1244639546.303:22): arch=c000003e syscall=59 success=yes exit=0 a0=1f1cd10 a1=1f1cd70 a2=1f1c8e0 a3=10 items=0 ppid=2585 pid=2586 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="consoletype" exe="/sbin/consoletype" subj=unconfined_u:system_r:consoletype_t:s0 key=(null)



Hash String generated from  selinux-policy-3.6.12-85.fc11,restorecon,consoletype,consoletype_t,user_home_t,file,write
audit2allow suggests:

#============= consoletype_t ==============
allow consoletype_t user_home_t:file write;

Comment 1 Daniel Walsh 2009-10-22 18:54:37 UTC
The problem here is a mislabled .xsession_errors file

Which the tool told you.

restorecon -R -v ~/.xsession-errors


Will fix.  Not sure how you got into this state.  Do you use gdm?  kdm? startx?

To start the session?

If it happens again please reopen the bugzilla.

Comment 2 Julien Humbert 2009-10-23 19:10:18 UTC
I used startx because of testing my video drivers, it had only happened when using startx, when using KDM it is fine.

Comment 3 Daniel Walsh 2009-10-26 14:33:38 UTC
# diff -u `pwd`/Xsession.old `pwd`/Xsession
--- /etc/X11/xinit/Xsession.old	2009-10-26 10:28:37.000000000 -0400
+++ /etc/X11/xinit/Xsession	2009-10-26 10:32:18.000000000 -0400
@@ -14,6 +14,7 @@
     errfile="$HOME/.xsession-errors"
     if ( umask 077 && cp /dev/null "$errfile" 2> /dev/null ); then
         chmod 600 "$errfile"
+        [ -x /sbin/restorecon ] && restorecon $errfile
         exec > "$errfile" 2>&1
     else
         errfile=$(mktemp -q /tmp/xses-$USER.XXXXXX)


Could you add restorecon to this Xsession script

Comment 4 Matěj Cepl 2009-11-05 17:18:51 UTC
Since this bugzilla report was filed, there have been several major updates in various components of the Xorg system, which may have resolved this issue. Users who have experienced this problem are encouraged to upgrade their system to the latest version of their packages (at least F12Beta, but even better if the very latest versions).

Please, if you experience this problem on the up-to-date system, let us now in the comment for this bug, or whether the upgraded system works for you.

If you won't be able to reply in one month, I will have to close this bug as INSUFFICIENT_DATA. Thank you.

[This is a bulk message for all open Fedora Rawhide Xorg-related bugs. I'm adding myself to the CC list for each bug, so I'll see any comments you make after this and do my best to make sure every issue gets proper attention.]

Comment 5 Daniel Walsh 2009-11-09 13:14:54 UTC
This bug has not been fixed by an update.  It should be really easy to fix.

Comment 6 Matěj Cepl 2009-11-10 21:16:20 UTC
Built in koji http://koji.fedoraproject.org/koji/taskinfo?taskID=1799205

Comment 7 Fedora Update System 2009-11-11 08:13:39 UTC
xorg-x11-xinit-1.0.9-13.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/xorg-x11-xinit-1.0.9-13.fc12

Comment 8 Fedora Update System 2009-11-12 00:59:32 UTC
xorg-x11-xinit-1.0.9-13.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update xorg-x11-xinit'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-11441

Comment 9 Bug Zapper 2009-11-16 14:04:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 Fedora Update System 2009-11-20 05:26:17 UTC
xorg-x11-xinit-1.0.9-13.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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