Bug 1471546

Summary: SELinux is preventing dnsmasq from search access on the directory root.
Product: [Fedora] Fedora Reporter: Audrey Yeena Toskin <audrey>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba, pmoore, ssekidde
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-19 08:18:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Audrey Yeena Toskin 2017-07-16 19:52:10 UTC
After making a fresh installation of Fedora 26 Workstation x86_64, I started to restore local file backups, including my entire home directory, virtual machines from /var/lib/libvirt/, /root/.bashrc, and a few things in /etc/, using rsync. During this operation, I hit *a lot* of SE Linux alerts, including this one, plus others that have already recently been reported.


SELinux is preventing dnsmasq from search access on the directory root.

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

If you believe that dnsmasq should be allowed search access on the root directory 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 'dnsmasq' --raw | audit2allow -M my-dnsmasq
# semodule -X 300 -i my-dnsmasq.pp

Additional Information:
Source Context                system_u:system_r:dnsmasq_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                root [ dir ]
Source                        dnsmasq
Source Path                   dnsmasq
Port                          <Unknown>
Host                          jean.localdomain
Source RPM Packages           
Target RPM Packages           filesystem-3.2-40.fc26.x86_64
Policy RPM                    selinux-policy-3.13.1-259.fc26.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     jean.localdomain
Platform                      Linux jean.localdomain 4.11.8-300.fc26.x86_64 #1
                              SMP Thu Jun 29 20:09:48 UTC 2017 x86_64 x86_64
Alert Count                   1
First Seen                    2017-07-16 00:49:22 PDT
Last Seen                     2017-07-16 00:49:22 PDT
Local ID                      7c3af17a-bef2-4629-bf38-cda8554717af

Raw Audit Messages
type=AVC msg=audit(1500191362.749:517): avc:  denied  { search } for  pid=1301 comm="dnsmasq" name="root" dev="dm-0" ino=256 scontext=system_u:system_r:dnsmasq_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir permissive=0


Hash: dnsmasq,dnsmasq_t,user_home_t,dir,search

Comment 1 Lukas Vrabec 2017-07-19 08:18:07 UTC
Hi Andrew, 

If you just moving files after fresh installation you should run "restorecon" command. 

# restorecon -Rv / 

This should fix your issue.