Bug 1652616 - SELinux is preventing systemd-logind from 'read' accesses on the blk_file mmcblk1p1.
Summary: SELinux is preventing systemd-logind from 'read' accesses on the blk_file mmc...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 29
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:b70851ec7665187712cb43a73da...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-22 13:23 UTC by Reuben John B. Unicruz
Modified: 2018-12-12 12:53 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-12 12:53:43 UTC
Type: ---


Attachments (Terms of Use)

Description Reuben John B. Unicruz 2018-11-22 13:23:14 UTC
Description of problem:
I am running a previously installed XFCE desktop environment (installed on Fedora 28) and then
I upgraded to Fedora 29. This bug is notified by SELinux everytime I login.

Source process: systemd-logind
Access attempt: read
On this blk_file: mmcblk1p1
SELinux is preventing systemd-logind from 'read' accesses on the blk_file mmcblk1p1.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that systemd-logind should be allowed read access on the mmcblk1p1 blk_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 'systemd-logind' --raw | audit2allow -M my-systemdlogind
# semodule -X 300 -i my-systemdlogind.pp

Additional Information:
Source Context                system_u:system_r:systemd_logind_t:s0
Target Context                system_u:object_r:removable_device_t:s0
Target Objects                mmcblk1p1 [ blk_file ]
Source                        systemd-logind
Source Path                   systemd-logind
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.2-42.fc29.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.18.18-300.fc29.x86_64 #1 SMP Mon
                              Nov 12 03:12:14 UTC 2018 x86_64 x86_64
Alert Count                   22
First Seen                    2018-11-15 14:42:19 EST
Last Seen                     2018-11-22 07:52:45 EST
Local ID                      282a45ba-d86b-450f-9c91-9cdcb6a4d29b

Raw Audit Messages
type=AVC msg=audit(1542891165.994:201): avc:  denied  { read } for  pid=780 comm="systemd-logind" name="mmcblk1p1" dev="devtmpfs" ino=14153 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:removable_device_t:s0 tclass=blk_file permissive=0


Hash: systemd-logind,systemd_logind_t,removable_device_t,blk_file,read

Version-Release number of selected component:
selinux-policy-3.14.2-42.fc29.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.6
hashmarkername: setroubleshoot
kernel:         4.18.18-300.fc29.x86_64
type:           libreport

Comment 1 Mai Ling 2018-12-10 00:11:24 UTC
Description of problem:
[asus@localhost ~]$ sudo systemctl hibernate 
Failed to hibernate system via logind: Resume not configured, can't hibernate
[asus@localhost ~]$ cat /proc/cmdline 
BOOT_IMAGE=(lvmid/2F7axh-bEl0-uw7n-qzUE-OQpz-BYi9-BiJNXR/plO7lX-71L1-8m2S-6Edf-AY73-WXSH-0mAS7U)/vmlinuz-4.20.0-0.rc4.git0.1.fc30.x86_64 root=/dev/mapper/luks-80694a92-6f48-4713-afe5-138fe0bab391 ro resume=/dev/mapper/luks-8aa66bee-1a48-45e5-8174-8c1871dea70e rd.lvm.lv=e403na/root rd.luks.uuid=luks-80694a92-6f48-4713-afe5-138fe0bab391 rd.lvm.lv=e403na/boot rd.lvm.lv=e403na/swap rd.luks.uuid=luks-8aa66bee-1a48-45e5-8174-8c1871dea70e rhgb quiet rd.luks.options=discard

[asus@localhost ~]$ journalctl -t setroubleshoot --no-pager 
-- Logs begin at Mon 2018-12-10 01:24:17 EET, end at Mon 2018-12-10 03:24:15 EET. --
dec 10 02:08:03 localhost.localdomain setroubleshoot[11952]: SELinux is preventing systemd-logind from read access on the blk_file mmcblk1p1. For complete SELinux messages run: sealert -l 2dbad456-0150-4426-9965-a205c53778d1

Version-Release number of selected component:
selinux-policy-3.14.2-42.fc29.noarch

Additional info:
reporter:       libreport-2.9.6
hashmarkername: setroubleshoot
kernel:         4.20.0-0.rc4.git0.1.fc30.x86_64
type:           libreport

Comment 2 Mai Ling 2018-12-10 00:14:35 UTC
upstream bug: https://github.com/systemd/systemd/issues/10613

Comment 3 Mai Ling 2018-12-10 00:40:59 UTC
workaround works for me from upstream bug comments: dowgrade to the systemd version before the change that broke.
dnf install systemd-239-3.fc29

Comment 4 Lukas Vrabec 2018-12-12 12:33:58 UTC
Added comment to github ticket, based on reply from Lennart I'll add needed allow rules.

Comment 5 Lukas Vrabec 2018-12-12 12:53:43 UTC
Fix in systemd should fix also this ticket.


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