Description of problem: "Swap" is in file /swap/swapfile and has swapfile_t type of selinux context Kernel cmdline has resume_offset=XXXXXX Run command: systemctl hibernate Hibernation work in Permissive mode SELinux is preventing systemd-logind from 'read' accesses on the file swapfile. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that systemd-logind should be allowed read access on the swapfile 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:swapfile_t:s0 Target Objects swapfile [ file ] Source systemd-logind Source Path systemd-logind Port <Unknown> Host (removed) Source RPM Packages Target RPM Packages SELinux Policy RPM selinux-policy-targeted-3.14.5-39.fc32.noarch Local Policy RPM selinux-policy-targeted-3.14.5-39.fc32.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name (removed) Platform Linux (removed) 5.6.15-300.fc32.x86_64 #1 SMP Fri May 29 14:23:59 UTC 2020 x86_64 x86_64 Alert Count 1 First Seen 2020-06-09 17:15:33 CEST Last Seen 2020-06-09 17:15:33 CEST Local ID 9eb6f3f1-ea6f-4854-9dd0-024688deea7c Raw Audit Messages type=AVC msg=audit(1591715733.458:1091): avc: denied { read } for pid=1238 comm="systemd-logind" name="swapfile" dev="dm-0" ino=257 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:swapfile_t:s0 tclass=file permissive=0 Hash: systemd-logind,systemd_logind_t,swapfile_t,file,read Version-Release number of selected component: selinux-policy-targeted-3.14.5-39.fc32.noarch Additional info: component: selinux-policy reporter: libreport-2.13.1 hashmarkername: setroubleshoot kernel: 5.6.15-300.fc32.x86_64 type: libreport
Zdenek, After discussion with systemd team, we should allow it, can you please prepare patches? Thanks, Lukas.
To avoid the actual hibernation, I added the PrivateDevices=yes line to the /usr/lib/systemd/system/systemd-hibernate.service file and called "systemctl daemon-reload".
I've submitted a Fedora PR to address the issue: https://github.com/fedora-selinux/selinux-policy/pull/452
Similar problem has been detected: 1. Install sddm 2. Create a swapfile 3. Add the swapfile to fstab 4. Reboot 5. Login hashmarkername: setroubleshoot kernel: 5.8.12-200.fc32.x86_64 package: selinux-policy-targeted-3.14.5-43.fc32.noarch reason: SELinux is preventing systemd-logind from 'read' accesses on the file swapfile. type: libreport
FEDORA-2020-77b49aa207 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-77b49aa207
FEDORA-2020-77b49aa207 has been pushed to the Fedora 32 testing repository. In short time you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-77b49aa207` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-77b49aa207 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2020-77b49aa207 has been pushed to the Fedora 32 stable repository. If problem still persists, please make note of it in this bug report.