Bug 1367279

Summary: SELinux is preventing systemd from 'getattr' accesses on the file /.swapfile.
Product: [Fedora] Fedora Reporter: Алексей Смирнов <debugger94>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:19f1427b65e293eae2f67224dfdc626fe1ee9b7f7ef34e60528f567d6ea1170d;VARIANT_ID=workstation;
Fixed In Version: selinux-policy-3.13.1-191.12.fc24 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-20 21:51:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Алексей Смирнов 2016-08-16 06:15:48 UTC
Description of problem:
SELinux is preventing systemd from 'getattr' accesses on the file /.swapfile.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If необходимо исправить метку.
Стандартная метка для /.swapfile: etc_runtime_t.
Then можно выполнить restorecon.
Do
# /sbin/restorecon -v /.swapfile

*****  Plugin catchall (1.49 confidence) suggests   **************************

If вы считаете, что systemd следует разрешить доступ getattr к .swapfile file по умолчанию.
Then рекомендуется создать отчет об ошибке.
Чтобы разрешить доступ, можно создать локальный модуль политики.
Do
allow this access for now by executing:
# ausearch -c 'systemd' --raw | audit2allow -M my-systemd
# semodule -X 300 -i my-systemd.pp

Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                unconfined_u:object_r:swapfile_t:s0
Target Objects                /.swapfile [ file ]
Source                        systemd
Source Path                   systemd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-191.10.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.6.4-301.fc24.x86_64 #1 SMP Tue
                              Jul 12 11:50:00 UTC 2016 x86_64 x86_64
Alert Count                   33
First Seen                    2016-06-23 06:55:29 MSK
Last Seen                     2016-08-16 09:14:12 MSK
Local ID                      b1a80604-26fd-4e6d-b1da-218f9dc13e98

Raw Audit Messages
type=AVC msg=audit(1471328052.257:264): avc:  denied  { getattr } for  pid=1 comm="systemd" path="/.swapfile" dev="sda1" ino=16 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_u:object_r:swapfile_t:s0 tclass=file permissive=0


Hash: systemd,init_t,swapfile_t,file,getattr

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

Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.6.4-301.fc24.x86_64
type:           libreport

Comment 1 Fedora Update System 2016-08-19 00:59:13 UTC
selinux-policy-3.13.1-191.12.fc24 has been pushed to the Fedora 24 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-2016-b37e51176b

Comment 2 Fedora Update System 2016-08-20 21:51:29 UTC
selinux-policy-3.13.1-191.12.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.