Bug 1399872 - SELinux is preventing lightdm from 'unlink' accesses on the file .xsession-errors.old.
Summary: SELinux is preventing lightdm from 'unlink' accesses on the file .xsession-er...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 24
Hardware: x86_64
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:84426103f44e17bbff4c5b611b1...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-30 00:10 UTC by Sergey
Modified: 2017-08-08 19:22 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 19:22:23 UTC
Type: ---


Attachments (Terms of Use)

Description Sergey 2016-11-30 00:10:33 UTC
Description of problem:
I have attached the /home volume previously used in FC20 installation to a 
fresh install of FC24 from xfce live cd disk. The relabelling does not help.
All actions the lightdm tries to perform on ~/.xsession-errors.* files denied by targeted SELinux policy
SELinux is preventing lightdm from 'unlink' accesses on the file .xsession-errors.old.

*****  Plugin catchall_labels (83.8 confidence) suggests   *******************

If you want to allow lightdm to have unlink access on the .xsession-errors.old file
Then you need to change the label on .xsession-errors.old
Do
# semanage fcontext -a -t FILE_TYPE '.xsession-errors.old'
where FILE_TYPE is one of the following: abrt_var_cache_t, alsa_home_t, antivirus_home_t, audio_home_t, auth_cache_t, auth_home_t, cache_home_t, cgroup_t, chrome_sandbox_home_t, config_home_t, cvs_home_t, data_home_t, dbus_home_t, etc_runtime_t, faillog_t, fetchmail_home_t, fonts_cache_t, gconf_home_t, git_user_content_t, gkeyringd_gnome_home_t, gkeyringd_tmp_t, gnome_home_t, gpg_secret_t, gstreamer_home_t, home_bin_t, home_cert_t, httpd_user_content_t, httpd_user_htaccess_t, httpd_user_ra_content_t, httpd_user_rw_content_t, httpd_user_script_exec_t, icc_data_home_t, iceauth_home_t, irc_home_t, irc_tmp_t, irssi_home_t, kdbusfs_t, kismet_home_t, krb5_home_t, krb5_host_rcache_t, local_login_home_t, locale_t, mail_home_rw_t, mail_home_t, mandb_home_t, mozilla_home_t, mozilla_plugin_tmp_t, mozilla_plugin_tmpfs_t, mpd_home_t, mpd_user_data_t, mplayer_home_t, mysqld_home_t, openshift_var_lib_t, pam_var_console_t, pam_var_run_t, polipo_cache_home_t, polipo_config_home_t, procmail_home_t, pulseaudio_home_t, rlogind_home_t, rssh_ro_t, rssh_rw_t, sandbox_file_t, screen_home_t, spamc_home_t, speech-dispatcher_home_t, ssh_home_t, svirt_home_t, systemd_home_t, systemd_passwd_var_run_t, telepathy_cache_home_t, telepathy_data_home_t, telepathy_gabble_cache_home_t, telepathy_logger_cache_home_t, telepathy_logger_data_home_t, telepathy_mission_control_cache_home_t, telepathy_mission_control_data_home_t, telepathy_mission_control_home_t, telepathy_sunshine_home_t, texlive_home_t, thumb_home_t, tvtime_home_t, uml_ro_t, uml_rw_t, user_fonts_cache_t, user_fonts_config_t, user_fonts_t, user_home_t, user_tmp_t, var_auth_t, virt_content_t, virt_home_t, vmware_conf_t, vmware_file_t, wine_home_t, wireshark_home_t, xauth_home_t, xdm_home_t, xdm_lock_t, xdm_log_t, xdm_rw_etc_t, xdm_spool_t, xdm_tmpfs_t, xdm_var_lib_t, xdm_var_run_t, xkb_var_lib_t, xserver_log_t.
Then execute:
restorecon -v '.xsession-errors.old'


*****  Plugin catchall (17.1 confidence) suggests   **************************

If you believe that lightdm should be allowed unlink access on the .xsession-errors.old 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:
# ausearch -c 'lightdm' --raw | audit2allow -M my-lightdm
# semodule -X 300 -i my-lightdm.pp

Additional Information:
Source Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Context                system_u:object_r:var_t:s0
Target Objects                .xsession-errors.old [ file ]
Source                        lightdm
Source Path                   lightdm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-191.21.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.8.8-200.fc24.x86_64 #1 SMP Tue
                              Nov 15 19:41:51 UTC 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-11-30 03:00:00 MSK
Last Seen                     2016-11-30 03:00:00 MSK
Local ID                      33cbfc52-6ba6-4d38-a072-f3bb83ad04a0

Raw Audit Messages
type=AVC msg=audit(1480464000.908:228): avc:  denied  { unlink } for  pid=1284 comm="lightdm" name=".xsession-errors.old" dev="dm-2" ino=1717315 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_t:s0 tclass=file permissive=0


Hash: lightdm,xdm_t,var_t,file,unlink

Version-Release number of selected component:
selinux-policy-3.13.1-191.21.fc24.noarch

Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.8.8-200.fc24.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2016-11-30 13:01:23 UTC
Sergey, 
Did you do full system relabeling? This should be fixed by restorecon 

Please run:
# restorecon -Rv /

Comment 2 Sergey 2016-11-30 16:58:19 UTC
(In reply to Lukas Vrabec from comment #1)
> Sergey, 
> Did you do full system relabeling? This should be fixed by restorecon 
> 

Yes, I did 'touch /.autorelabel; reboot' and I observed some warning messages during startup on files I have hardlinked in ~/.wine sub-directories and outside, so this confirms that the relabelling were traversing new /home.

> Please run:
> # restorecon -Rv /

I think it is a bit late as I did install the custom policy as SE troubleshooter suggests.

Regards,
Sergey

Comment 3 Fedora End Of Life 2017-07-26 00:01:06 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2017-08-08 19:22:23 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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