Bug 1374966

Summary: thunar not showing the removable devices on insert
Product: [Fedora] Fedora Reporter: Viorel Tabara <viorel.tabara>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-12 10:14:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Viorel Tabara 2016-09-11 03:33:46 UTC
Description of problem:
=======================

When I insert a USB or CD/DVD the Xfce file manager (Thunar) won't show the 
removable device in the side panel. There are no errors or SELinux alerts. To 
troubleshoot I tried 'udisksctl status' which failed and that triggered an 
alert. See steps below for details.


Version-Release number of selected component (if applicable):

[root@omiday selinux]# rpm -qa --last "*selinux*"
selinux-policy-targeted-3.13.1-211.fc25.noarch Fri 26 Aug 2016 11:04:33 PM MDT
selinux-policy-3.13.1-211.fc25.noarch         Fri 26 Aug 2016 11:04:23 PM MDT
rpm-plugin-selinux-4.13.0-0.rc1.46.fc25.x86_64 Fri 26 Aug 2016 11:04:21 PM MDT
libselinux-2.5-11.fc25.i686                   Wed 24 Aug 2016 12:35:34 AM MDT
libselinux-utils-2.5-11.fc25.x86_64           Thu 11 Aug 2016 01:59:23 PM MDT
libselinux-python-2.5-11.fc25.x86_64          Thu 11 Aug 2016 01:58:50 PM MDT
libselinux-python3-2.5-11.fc25.x86_64         Thu 11 Aug 2016 01:58:41 PM MDT
libselinux-2.5-11.fc25.x86_64                 Thu 11 Aug 2016 01:56:43 PM MDT

[root@omiday selinux]# rpm -qf --last /usr/libexec/udisks2/udisksd 
storaged-2.6.2-2.fc25.x86_64                  Tue 06 Sep 2016 06:37:47 PM MDT
  
[root@omiday selinux]# uname -r
4.8.0-0.rc4.git0.1.fc25.x86_64
 

How reproducible:
=================

Always.


Steps to Reproduce:
===================

1. Confirm that SELinux is in 'enforcing' mode.

2. Open an Xfce session.

3. Start Thunar.

4. Insert a USB/CD/DVD media.

5. Run: udisksctl status 

6. Switch SELinux to permissive.

7. Repeat step 5.

8. Log out.

9. Kill all processes for the user account (I do it by switching to a console 
   screen and login as 'root' the 'pkill -9 -U <user>')

10. Login as user.

11. Open Thunar.

12. Insert a removable media.

13. Remove media.

14. Switch SELinux to 'enforcing'.

15. Insert media.

16. Repeat step 5.


Actual results:
===============

4. Media is not displayed in the side panel. No SELinux alerts.

5. Error:

      omiday ~ $ udisksctl status
      Error connecting to the udisks daemon: Timeout was reached

   SELinux alerts:

      Sep 10 16:47:18 omiday.can.local audit[4813]: AVC avc:  denied  { search } for  pid=4813 comm="udisksd" name=".cache" dev="dm-1" ino=2621448 scontext=system_u:system_r:udisks2_t:s0 tcontext=system_u:object_r:cache_home_t:s0 tclass=dir permissive=0
      Sep 10 16:47:18 omiday.can.local audit[4813]: AVC avc:  denied  { read } for  pid=4813 comm="udisksd" name="sr0" dev="devtmpfs" ino=1348 scontext=system_u:system_r:udisks2_t:s0 tcontext=system_u:object_r:removable_device_t:s0 tclass=blk_file permissive=0
      Sep 10 16:47:18 omiday.can.local audit[4813]: AVC avc:  denied  { wake_alarm } for  pid=4813 comm="udisksd" capability=35  scontext=system_u:system_r:udisks2_t:s0 tcontext=system_u:system_r:udisks2_t:s0 tclass=capability2 permissive=0
      Sep 10 16:47:18 omiday.can.local audit[4813]: AVC avc:  denied  { read } for  pid=4813 comm="udisksd" name="sr0" dev="devtmpfs" ino=1348 scontext=system_u:system_r:udisks2_t:s0 tcontext=system_u:object_r:removable_device_t:s0 tclass=blk_file permissive=0

7. Completes successfully:

      omiday ~ $ udisksctl status
      MODEL                     REVISION  SERIAL               DEVICE
      --------------------------------------------------------------------------
      Samsung SSD 850 EVO 500GB EMT02B6Q  S2RANX0H581357R      sda     
      HL-DT-ST DVD+-RW GT50N    A101      KY2C6L25244          sr0     
      USB 2.0 Flash Drive       8.07      CA931240             sdb     
 
12. Media will be displayed in the side panel.

13. Media item will be removed from the side panel.

15. Media is not displayed in the side panel. No SELinux alerts.

16. Same error as in step 5. No SELinux alerts.

   
Expected results:
=================

No errors and Thunar functional when SELinux is enforced.


Additional info:
================

I turned off 'dontaudit' and repeated steps 12, 13 and 16. The results are:

12 & 13:

   I. A flood of SELinux AVC denials related to comm=udisksd and 
      tclass=netlink_kobject_uevent_socket:

         [root@omiday selinux]# ausearch -m avc -ts "19:30" 2>&1 | tee udisksd.dontaudit 

         [root@omiday selinux]# fgrep "type=AVC" udisksd.dontaudit  | fgrep -v 
         -c 'comm="udisksd"'
         0

         [root@omiday selinux]# fgrep "type=AVC" udisksd.dontaudit  | fgrep -v -c "avc:  denied"
         0

         [root@omiday selinux]# fgrep "type=AVC" udisksd.dontaudit  | fgrep -v -c "tclass=netlink_kobject_uevent_socket"
         0

         [root@omiday selinux]# fgrep "type=AVC" udisksd.dontaudit  | fgrep -c "tclass=netlink_kobject_uevent_socket"
         181137

         [root@omiday selinux]# fgrep "type=AVC" udisksd.dontaudit  | sed 's/msg=audit(.\+): //g' | wc -l
         181137

         [root@omiday selinux]# fgrep "type=AVC" udisksd.dontaudit  | sed 's/msg=audit(.\+): //g' | sort -u
   type=AVC avc:  denied  { read } for  pid=14526 comm="udisksd" scontext=system_u:system_r:udisks2_t:s0 tcontext=system_u:system_r:udisks2_t:s0 tclass=netlink_kobject_uevent_socket permissive=0

   II. Also the following SELinux messages are logged:

          Sep 10 20:05:13 omiday.can.local setroubleshoot[23850]: Unable to add audit event: node=omiday.can.local type=AVC msg=audit(1473559485.355:3465178): avc:  denied  { read } for  pid=14526 comm="udisksd" scontext=system_u:system_r:udisks2_t:s0 tcontext=system_u:system_r:udisks2_t:s0 tclass=netlink_kobject_uevent_socket permissive=0
                                                         
                                                                  **** Invalid AVC dontaudited in current policy.  'semodule -B' will turn on dontaudit rules. ***
 
   III. 'udisksd' CPU usage spikes to 100% and stay there until killed.

16. No SELinux alerts.

Comment 1 Fedora Admin XMLRPC Client 2016-09-27 15:04:18 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 2 Fedora End Of Life 2017-11-16 19:13:57 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. 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 '25'.

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 25 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 3 Fedora End Of Life 2017-12-12 10:14:47 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 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.