Bug 1645770 - selinux is blocking gdm from accessing dosfs_t files, breaking the grub hidden menu feature
Summary: selinux is blocking gdm from accessing dosfs_t files, breaking the grub hidde...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-03 14:18 UTC by Hans de Goede
Modified: 2018-11-09 06:02 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-09 06:02:01 UTC


Attachments (Terms of Use)

Description Hans de Goede 2018-11-03 14:18:44 UTC
When rebooting using the GNOME3 system menu from within gdm, gnome-session calls the grub2-set-bootflag helper to modify the grubenv (which sets on the UEFI ESP partition which is vfat) to indicate that this was a user initiated reboot and that the previous boot thus was successful, so that the grub menu will stay hidden.

This currently does not work with selinux in enforcing mode. Strange enough I only get 1 AVC in audit.log and only when selinux is in permissive mode, it seems that the earlier read deny does not logged?

The AVC which I got is:

type=AVC msg=audit(1541252809.861:288): avc:  denied  { write } for  pid=4632 comm="grub2-set-bootf" name="grubenv" dev="nvme0n1p1" ino=5 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:dosfs_t:s0 tclass=file permissive=1

Anyways with some help from audit2allow + a small manual edit I've managed to fix this locally using a selinux module with the following allow line in there:

allow xdm_t dosfs_t:file { open read write } ;

Can the official Fedora selinux policy please be modified to allow gdm (xdm_t) access to dosfs_t files?

Comment 1 Lukas Vrabec 2018-11-04 17:06:04 UTC
commit 62d90da2a38c1a701a5f177feb861d0d75357d55 (HEAD -> rawhide)
Author: Lukas Vrabec <lvrabec@redhat.com>
Date:   Sun Nov 4 18:05:48 2018 +0100

    Allow xdm_t domain to manage dosfs_t files BZ(1645770)

Comment 2 Fedora Update System 2018-11-05 08:19:18 UTC
selinux-policy-3.14.2-42.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-3129f981d3

Comment 3 Fedora Update System 2018-11-06 22:00:00 UTC
selinux-policy-3.14.2-42.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-3129f981d3

Comment 4 Fedora Update System 2018-11-09 06:02:01 UTC
selinux-policy-3.14.2-42.fc29 has been pushed to the Fedora 29 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.