Bug 2091275

Summary: SELinux is preventing chronyd from 'getattr' accesses on the file /run/NetworkManager/no-stub-resolv.conf.
Product: [Fedora] Fedora Reporter: Sam Varshavchik <mrsam>
Component: selinux-policyAssignee: Nikola Knazekova <nknazeko>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 36CC: dwalsh, grepl.miroslav, ipilcher, lvrabec, mmalik, nknazeko, omosnace, pkoncity, vmojzis, zpytela
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:19b1b5a29db252c74c851feb11fce7f6e635b0737713b775c3defc22f5755c45;VARIANT_ID=xfce;
Fixed In Version: selinux-policy-36.16-1.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-10-12 13:01:34 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 Sam Varshavchik 2022-05-28 12:36:53 UTC
Description of problem:
AVC alert after removing systemd-resolved and installing a symlink from /etc/resolv.conf to ../run/systemd/resolve/stub-resolv.conf
SELinux is preventing chronyd from 'getattr' accesses on the file /run/NetworkManager/no-stub-resolv.conf.

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

If you believe that chronyd should be allowed getattr access on the no-stub-resolv.conf 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 'chronyd' --raw | audit2allow -M my-chronyd
# semodule -X 300 -i my-chronyd.pp

Additional Information:
Source Context                system_u:system_r:chronyd_t:s0
Target Context                system_u:object_r:NetworkManager_var_run_t:s0
Target Objects                /run/NetworkManager/no-stub-resolv.conf [ file ]
Source                        chronyd
Source Path                   chronyd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-36.8-2.fc36.noarch
Local Policy RPM              selinux-policy-targeted-36.8-2.fc36.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.17.9-300.fc36.x86_64 #1 SMP
                              PREEMPT Wed May 18 15:08:23 UTC 2022 x86_64 x86_64
Alert Count                   4
First Seen                    2022-05-28 08:29:29 EDT
Last Seen                     2022-05-28 08:30:25 EDT
Local ID                      00873bad-debc-47f7-b0cf-3846daca5f49

Raw Audit Messages
type=AVC msg=audit(1653741025.103:282): avc:  denied  { getattr } for  pid=856 comm="chronyd" path="/run/NetworkManager/no-stub-resolv.conf" dev="tmpfs" ino=1525 scontext=system_u:system_r:chronyd_t:s0 tcontext=system_u:object_r:NetworkManager_var_run_t:s0 tclass=file permissive=0


Hash: chronyd,chronyd_t,NetworkManager_var_run_t,file,getattr

Version-Release number of selected component:
selinux-policy-targeted-36.8-2.fc36.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.17.1
hashmarkername: setroubleshoot
kernel:         5.17.9-300.fc36.x86_64
type:           libreport

Comment 1 Sam Varshavchik 2022-05-28 12:42:39 UTC
Correction:

lrwxrwxrwx. 1 root root 41 May 28 08:27 /etc/resolv.conf -> ../run/NetworkManager/no-stub-resolv.conf

Comment 2 Ian Pilcher 2022-05-28 14:27:57 UTC
I'm running F36 without systemd-resolved (RPM not installed) and chronyd is running just fine.  I don't see this AVC,

Comment 3 Nikola Knazekova 2022-09-07 13:49:45 UTC
*** Bug 2088982 has been marked as a duplicate of this bug. ***

Comment 4 Zdenek Pytela 2022-09-12 15:09:41 UTC
*** Bug 2093556 has been marked as a duplicate of this bug. ***

Comment 5 Fedora Update System 2022-09-30 08:49:49 UTC
FEDORA-2022-0c59a07653 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-0c59a07653

Comment 6 Fedora Update System 2022-10-01 02:12:56 UTC
FEDORA-2022-0c59a07653 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-0c59a07653`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-0c59a07653

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2022-10-12 13:01:34 UTC
FEDORA-2022-0c59a07653 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.