Bug 1661724

Summary: SELinux is preventing /usr/lib/systemd/systemd-rfkill from 'unlink' accesses on the file /var/lib/systemd/rfkill/pci-0000:05:00.0:wlan.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED DUPLICATE QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh, lvrabec, mgrepl, mmalik, plautrba, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:733201f908aa45590f1ef96d3e5e36bf82559eee634d815110c65b9dc30eaf26;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-08 16:50:26 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 Mikhail 2018-12-22 17:45:00 UTC
Description of problem:
SELinux is preventing /usr/lib/systemd/systemd-rfkill from 'unlink' accesses on the file /var/lib/systemd/rfkill/pci-0000:05:00.0:wlan.

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

If you want to fix the label. 
/var/lib/systemd/rfkill/pci-0000:05:00.0:wlan default label should be systemd_rfkill_var_lib_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /var/lib/systemd/rfkill/pci-0000:05:00.0:wlan

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

If you believe that systemd-rfkill should be allowed unlink access on the pci-0000:05:00.0:wlan 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-rfkill' --raw | audit2allow -M my-systemdrfkill
# semodule -X 300 -i my-systemdrfkill.pp

Additional Information:
Source Context                system_u:system_r:systemd_rfkill_t:s0
Target Context                system_u:object_r:unlabeled_t:s0
Target Objects                /var/lib/systemd/rfkill/pci-0000:05:00.0:wlan [
                              file ]
Source                        systemd-rfkill
Source Path                   /usr/lib/systemd/systemd-rfkill
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           systemd-udev-239-10.git3bf819c.fc30.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.3-15.fc30.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.20.0-0.rc7.git1.1.fc30.x86_64 #1
                              SMP Tue Dec 18 22:52:01 UTC 2018 x86_64 x86_64
Alert Count                   1
First Seen                    2018-12-22 22:39:16 +05
Last Seen                     2018-12-22 22:39:16 +05
Local ID                      5cf2e687-00d1-4f7e-bd88-11bd21cdc2f0

Raw Audit Messages
type=AVC msg=audit(1545500356.132:257): avc:  denied  { unlink } for  pid=955 comm="systemd-rfkill" name="pci-0000:05:00.0:wlan" dev="nvme0n1p2" ino=2883639 scontext=system_u:system_r:systemd_rfkill_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file permissive=0


type=SYSCALL msg=audit(1545500356.132:257): arch=x86_64 syscall=rename success=no exit=EACCES a0=55a54ab7c3a0 a1=55a54ab7d430 a2=0 a3=a items=4 ppid=1 pid=955 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=systemd-rfkill exe=/usr/lib/systemd/systemd-rfkill subj=system_u:system_r:systemd_rfkill_t:s0 key=(null)

type=CWD msg=audit(1545500356.132:257): cwd=/

type=PATH msg=audit(1545500356.132:257): item=0 name=/var/lib/systemd/rfkill/ inode=2884277 dev=103:02 mode=040755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:systemd_rfkill_var_lib_t:s0 nametype=PARENT cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0

type=PATH msg=audit(1545500356.132:257): item=1 name=/var/lib/systemd/rfkill/ inode=2884277 dev=103:02 mode=040755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:systemd_rfkill_var_lib_t:s0 nametype=PARENT cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0

type=PATH msg=audit(1545500356.132:257): item=2 name=/var/lib/systemd/rfkill/.#pci-0000:05:00.0:wlanANIqQg inode=2883640 dev=103:02 mode=0100644 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:systemd_rfkill_var_lib_t:s0 nametype=DELETE cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0

type=PATH msg=audit(1545500356.132:257): item=3 name=/var/lib/systemd/rfkill/pci-0000:05:00.0:wlan inode=2883639 dev=103:02 mode=0100644 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=DELETE cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0

Hash: systemd-rfkill,systemd_rfkill_t,unlabeled_t,file,unlink

Version-Release number of selected component:
selinux-policy-3.14.3-15.fc30.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.7
hashmarkername: setroubleshoot
kernel:         4.20.0-0.rc7.git1.1.fc30.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2019-01-08 16:50:26 UTC

*** This bug has been marked as a duplicate of bug 1661719 ***