Bug 1898800

Summary: SELinux is preventing systemd-resolve from 'create' accesses on the lnk_file .#stub-resolv.conf0e7c3c1bedd8d0aa.
Product: [Fedora] Fedora Reporter: gorkodashvili1
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 33CC: dwalsh, grepl.miroslav, lvrabec, mmalik, plautrba, quintela, thomas, vmojzis, zpytela
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:3a40970197403cf064490e54bc9a4ad793b3d34c1d56bb72a17b1bca1dd2db35;VARIANT_ID=matecompiz;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-08 15:10:09 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 gorkodashvili1 2020-11-18 04:57:34 UTC
Description of problem:
Because of conflict between dnsmasq and systemd-resolved I have in the following line in /etc/systemd/resolved.conf
DNSStubListener=no
This is a big problem since it prevents my podman containers to start:
Error: unable to start container "whatever": error creating resolv.conf for container whatever: lstat /etc/../run/systemd/resolve/stub-resolv.conf: no such file or directory
SELinux is preventing systemd-resolve from 'create' accesses on the lnk_file .#stub-resolv.conf0e7c3c1bedd8d0aa.

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

If you believe that systemd-resolve should be allowed create access on the .#stub-resolv.conf0e7c3c1bedd8d0aa lnk_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-resolve' --raw | audit2allow -M my-systemdresolve
# semodule -X 300 -i my-systemdresolve.pp

Additional Information:
Source Context                system_u:system_r:systemd_resolved_t:s0
Target Context                system_u:object_r:systemd_resolved_var_run_t:s0
Target Objects                .#stub-resolv.conf0e7c3c1bedd8d0aa [ lnk_file ]
Source                        systemd-resolve
Source Path                   systemd-resolve
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            <Unknown>
Local Policy RPM              selinux-policy-targeted-3.14.6-30.fc33.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.9.8-200.fc33.x86_64 #1 SMP Tue
                              Nov 10 21:58:19 UTC 2020 x86_64 x86_64
Alert Count                   12
First Seen                    2020-11-17 12:10:04 +04
Last Seen                     2020-11-18 08:50:01 +04
Local ID                      8ec73e3a-1dd2-4665-9c55-c653288dbc03

Raw Audit Messages
type=AVC msg=audit(1605675001.250:1731): avc:  denied  { create } for  pid=5053 comm="systemd-resolve" name=".#stub-resolv.conf0e7c3c1bedd8d0aa" scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_resolved_var_run_t:s0 tclass=lnk_file permissive=0


Hash: systemd-resolve,systemd_resolved_t,systemd_resolved_var_run_t,lnk_file,create


Additional info:
component:      selinux-policy
reporter:       libreport-2.14.0
hashmarkername: setroubleshoot
kernel:         5.9.8-200.fc33.x86_64
type:           libreport

Comment 1 Thomas Köller 2020-12-04 12:18:30 UTC
Similar problem has been detected:

Happens during systemd startup.

hashmarkername: setroubleshoot
kernel:         5.9.11-200.fc33.x86_64
package:        selinux-policy-targeted-3.14.6-30.fc33.noarch
reason:         SELinux is preventing systemd-resolve from 'create' accesses on the lnk_file .#stub-resolv.confc6c1c62729778544.
type:           libreport

Comment 2 Zdenek Pytela 2020-12-08 15:10:09 UTC

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